Questions tagged [playwright]

Playwright is a library to automate Chromium, WebKit and Firefox with a single API. Playwright is similar to Puppeteer, but with cross-browser support and Python, Java, and .NET bindings, in addition to Node.js.

Filter by
Sorted by
Tagged with
0 votes
0 answers
16 views

Need to pass previous build results in HTML test report in playwright

I am trying to show for each test case the previous build status of the test case. I am trying to achieve using test.info() in playwright. But test.info() cannot be accessed from onTestEnd in ...
Shanjay Nithiin's user avatar
-3 votes
0 answers
22 views

Improvements in Playwright automated tests [closed]

I have a front end automated testing environment - e2e tests in Playwright and TypeScript. What improvements could they make to their automated testing environment? What improvements does Playwright ...
martine's user avatar
  • 73
0 votes
0 answers
17 views

Node Playwright - How to remove part of visible content by checking off checkbox?

In the html there is an input, that I need to check so that content is NOT being shown (Im doing that because otherwise I would need to scrape content with pagination). <input type="checkbox&...
learncode's user avatar
  • 218
1 vote
0 answers
18 views

Playwright: How can I scroll to element to load fire lazy loading?

I have a page with hundreds of graphs that all display null values until you scroll them into view. I want to assert the values for a specific graph that is halfway down the page, if I use ...
Doctor Who's user avatar
  • 1,317
0 votes
1 answer
39 views

Playwright equivalent for JavaScript's "closest" function

Playwright lacks an equivalent for JavaScript's closest() function. Is there a flexible way to do that using XPath?
lonix's user avatar
  • 15.2k
0 votes
0 answers
16 views

Playwright how to wait till website reloads?

My current code logs me in on buff.163. The only problem is that before the page reloads and logs me in there is a around 3 seconds delay. I already tried page.wait_for_load_state("load") ...
BlackPhantom's user avatar
-1 votes
0 answers
18 views

Here I want to execute the second test case without login to the application - playwright-TypeScript [closed]

I want to execute the second test case without login to the application - playwright-TypeScript test.describe('E2E test flows', () => { test("TC ID : 4513 - User Login ", async ({ ...
rajendra prasad's user avatar
-1 votes
0 answers
54 views

Playwright saves old html

I'm trying to scrape the prices from buff.163, but I cant find them in the html that was saved. My code looks like this: from playwright.sync_api import sync_playwright with sync_playwright() as p: ...
BlackPhantom's user avatar
0 votes
0 answers
15 views

playwright storageSession failing inside docker containers in gitlab pipeline

I'm trying to use playwright inside of docker containers in our Gitlab ci pipeline. I followed the playwright Authenticate documentation. Locally the tests works fine, no issues but in the pipeline it ...
jaycarn's user avatar
0 votes
1 answer
45 views

Text input is cleared right after focus moves away in Playwright Python

I have a text input field which is present on a popup window that requires a 6-digit text input in string format. It seems that there's a background check to verify whether the input is a 6-digit ...
Matin's user avatar
  • 101
1 vote
1 answer
38 views

Playwright - why does page.content sometimes return nothing?

In 7/10 times I can access and get the content with page.content(), but in 3/10 approx. times I get nothing back. I have logged the html I get in both cases (where I get all the page content and where ...
learncode's user avatar
  • 218
0 votes
1 answer
33 views

How do I import a utility in my playwright test while using typescript?

I am writing a basic playwright project using typescript. I am trying to introduce a logger.ts that should handle creation of log files and logging any logger.info messages in the log file. I tried ...
AabinGunz's user avatar
  • 12.2k
0 votes
1 answer
11 views

How to parametrize fixtures in playwright-Node

I have a classic file with fixtures and test extends: import { test } from "@playwright/test" export type pages = { functionality: Functionality } export const base = test.extend<...
Vitto's user avatar
  • 269
1 vote
1 answer
27 views

Unable to download PDF file using playwright with js because it's open in preview mode in Chrome browser [closed]

I am facing an issue where I am unable to download a PDF file because it opens in the preview mode in the Chrome browser i want to enable this option using playwright with JS so i can download ...
Avinash Chauhan's user avatar
2 votes
0 answers
24 views

Playwright - How can parallel tests handle a bottleneck?

I am having some trouble running some Playwright tests in parallel. The challenge is that each test has three step, and only the 1st and 3rd steps can run in parallel. The 2nd step must be taken after ...
KHeidtman's user avatar
0 votes
0 answers
11 views

How to deploy an app on heroku that uses playwright and doesnt crash?

I am using playwright to scrape a websites contents. It all works fine in development. After deploying it on heroku, it sometimes works but 8/10 times it crashes. I noticed that It works right after I ...
learncode's user avatar
  • 218
0 votes
2 answers
38 views

How do I click on "Next" button until it disappears in playwright (typescript)

Here is the code I am using to click next button until it disappears on pagination. Then, I can verify the record on the last page The issue is, when it is in the last page, still tries to find the ...
Murat's user avatar
  • 1
0 votes
0 answers
10 views

playwright sometimes getting message -Error: Test ended. Browser logs: - in test.afterEach

playwright sometimes getting message -Error: Test ended. Browser logs: - in test.afterEach . Is there a reason why? Playwright Version: "@playwright/test": "1.40.0" Google Chrome ...
Michael BugX07's user avatar
1 vote
0 answers
58 views

How to break from playwright page.expect_download()?

Is there some way to "break" from playwright page.expect_download() waiting for download? Like if I want to stop current download without crashing everything by pressing button in my gui. My ...
Gh0sTG0's user avatar
  • 111
0 votes
1 answer
39 views

Playwright how to handle new windows

Im trying to login with steam on https://buff.163.com. My current code looks like this. from playwright.sync_api import sync_playwright with sync_playwright() as p: browser = p.chromium.launch(...
BlackPhantom's user avatar
1 vote
2 answers
47 views

How to verify multiple assertions in single test without skipping if anyone fails

I need to run multiple links on a single test. The test scenarios are almost the same for the 4 links, but will have different color or data. I have tried this, but once link A has failed, it will ...
carlosng07's user avatar
0 votes
0 answers
20 views

When i inspect manually and set the view port size from responsive, the UI is working fine but when i do it from code, its not showing the exact UI

When i inspect manually and set the view port size from responsive, the UI is working fine but when i do it from code, its not showing the exact UI below is my code used for simulating the UI to ...
Akhil Nath's user avatar
-3 votes
0 answers
66 views

I am new to using typescript. I need more knowledge of loops [closed]

I want to convert my for loop into forEach loop in vs code const payTabs = page.locator("employeePayOption"); for (let i = 0; i < (await pay.count() - 1); i++) { const singlePayTab = ...
QA2012's user avatar
  • 1
0 votes
0 answers
17 views

How to group test cases by file hierarchy to show test results in allure report

I have Allure reporter integration to my Playwright test. My configuration files looks like the following // @ts-check const { defineConfig, devices } = require("@playwright/test"); /** * @...
Ghuman's user avatar
  • 23
-1 votes
0 answers
25 views

Playwright toHaveCount

I have a table which has 25 rows, but when I check the number of child elements in it, somehow, I get 2. expect(this.schedulerTable).toHaveCount(25); Expected: 25 Received: 2 What might be the reason?...
Артем 's user avatar
0 votes
1 answer
40 views

Playwright how to work with re-usable methods in tests

I want to create methods and re-use them in tests for API testing. Here is my scenario and code // subscriptionApitests.spec.js import { getSubscriptionsFromAPI } from "./subscriptionapi.js"...
Ghuman's user avatar
  • 23
0 votes
0 answers
36 views

Failed to create driver Failed to install browsers, exit code: 1 when playwright Java is tried to run via BrowserStack on firewalled Jenkins server

I get below issue in a company owned Jenkins Server when I tried to build Playwright Java code which runs via chromium bowser in BrowserStack. java.lang.RuntimeException: Failed to create driver ...
Sameera De Silva's user avatar
1 vote
1 answer
39 views

Playwright doesn't find dynamic element

I'm trying to login on buff.163.com. Playwright does click on the Login button but it seems like it can't find the login with password hyperlink. My current code looks like this: from playwright....
BlackPhantom's user avatar
0 votes
0 answers
34 views

Problem in publishing artifacts in Jenkins

Background I have a Jenkins pipeline setup on an enterprise network. To build the image, I have a Dockerfile that uses the official Playwright image and installs some dependencies. I push my image to ...
Aayush Sahu's user avatar
1 vote
2 answers
69 views

Retrieve list of all the elements on a page

I clearly don't understand how locators work. How do I retrieve a list of all the elements on a page where the name matches a pattern? // this was translated from javascript public async Task&...
BWhite's user avatar
  • 741
-2 votes
0 answers
31 views

Playwirght. Screenshots compare failed on the same enviroment

System info • Playwright Version: [v1.24] • Operating System: [Linux] • Browser: [Firefox] Localy everything is ok. I get an expected results. But when I run test in CI, Firefox cases failed with this ...
AGadzhiev's user avatar
0 votes
1 answer
43 views

Playwright: Finding Child Elements Inside Parent Locator

I would find 'div.vc_col-sm-4 h4' if only they are inside 'div.vc_col-sm-4 div.wpb_wrapper' using the locator: const title = page.locator('div.vc_col-sm-4 div.wpb_wrapper').locator('div.vc_col-sm-4 h4'...
Lele Mabur's user avatar
0 votes
1 answer
26 views

Failed to load resource: SSL peer certificate or SSh remote key was not OK

I am developing an application with angular and .net. I happen to be testing the angular application with playwright. The test they need to pass is to pass the login screen. It turns out that when I ...
Stella Esparza's user avatar
0 votes
0 answers
12 views

Pytest add arguments to playwright browser

How to send a browser argument to a browser from playwright under pytest? For example: I need to call firefox --profile=/directoryofmyprofile
Hola Soy Edu Feliz Navidad's user avatar
0 votes
0 answers
21 views

how to get "out of process iframe" by Chrome DevTools Protocol(Playwright)

Page.getFrameTree interface can't get "out of process iframe". browser = playwright.chromium.connect_over_cdp("http://localhost:9222") default_context = browser.contexts[0]...
maikesi wu's user avatar
0 votes
0 answers
35 views

Multiprocessing with TypeScript + playwright

Recently, I developed a web application using React that communicates with a Flask server and launches a script in a separate process using multiprocessing. This process triggers a browser controlled ...
Mateusz Dariusz Szymczyk's user avatar
0 votes
1 answer
48 views

Python Classes initialized by equal parameters do not equal

Im trying to debug my program, in which two classes, which are initialized by equal (note: == comparison not is) arguments. An example code + a snippet of the class + a object comparison is shown ...
cfvWEW's user avatar
  • 23
1 vote
1 answer
41 views

Playwright does not generate report in Docker

I have the following playwright configuration that works as intended when run from command line. (Reports are generated.) playwright.config.ts export default defineConfig({ testDir: './tests', ...
Márk Kalinovits's user avatar
-2 votes
0 answers
22 views

How to prevent playwright from changing my dates? [closed]

Playwright's --ui chromium browser is changing my dates: When I create a date: // const tmrw = new Date(2023, 3, 12, 18, 36) // same issue const tmrw = new Date('Wed Apr 12 2023 18:36:00 GMT-0600 (...
Nate May's user avatar
  • 3,870
0 votes
1 answer
115 views

Error: browserType.launch: Chromium distribution 'chrome' is not found at /opt/google/chrome/chrome

I'm trying to run Playwright tests on Playwright Docker. To run Docker I've used next command: docker run --rm --network host -v $(pwd):/work/ -w /work/ -it mcr.microsoft.com/playwright:v1.40.0-jammy /...
nataliia's user avatar
0 votes
1 answer
62 views

How can I replicate this cy.intercept in Playwright?

I am looking to migrate my test suite from Cypress to Playwright. I have hit a hurdle as I came to API requests. Within my test suite, I want to wait for network request to be completed and return a ...
tommy z's user avatar
0 votes
0 answers
56 views

playwright with typescript failing to build

I ran npm init playwright@latest, provided src/tests as the test directory, and typescript as the language. I did not change anything on playwright.config.ts. Next, I created the src/tests/e2e.spec.ts ...
JobaDiniz's user avatar
  • 882
0 votes
0 answers
18 views

Access is denied option and build was failure when running the jenkins due to git tool is none: What does that mean?

Started by user Umer Ejaz Running as SYSTEM Building in workspace C:\Program Files\Jenkins\data\jenkins_home\workspace\Playwright_series The recommended git tool is: NONE No credentials specified C:\...
Umer's user avatar
  • 1
0 votes
0 answers
29 views

With Playwright, is it possible to retrieve the cookies set in the browser while logging in to Salesforce application? [closed]

With Playwright, is it possible to retrieve the cookies set in the browser while logging in to Salesforce application? I need to bypass the login screen of Salesforce application. I am using this code ...
CMP's user avatar
  • 1
1 vote
1 answer
71 views

How to verify an API request has not been made with Playwright

I have a chat application that I'm writing Playwright tests for. There is a textbox where the user can write their message. When the user presses Enter, the message should be sent. When the user ...
Magnar Myrtveit's user avatar
0 votes
0 answers
29 views

How to put graphs in Playwright report

Im currently playing around with playwright(automate several test)/typescript and i want a general donut graph and/or in each test suite in the reporter I tried to use mochawesome but the reporter ...
Luominous's user avatar
1 vote
1 answer
74 views

How to print the element text in Playwright Python?

How to print the element text in playwright python? self.error_alert_text = page.locator("#alert .modal > p") I have tried with print(self.error_alert_text.get_by_text())) But nothing ...
Manoj Soundarrajan's user avatar
0 votes
0 answers
21 views

vite important.meta.env.MODE in Playwright error

I have a config file (constants.ts) in my vite/react repo that determines which API endpoint to use. eg const API_ENV = { staging: 'https://api.staging.acme.io', prod: 'https://api.prod.acme.io', ...
Shannon Smith's user avatar
2 votes
2 answers
56 views

Scrapy-playwright with multiple start_urls

Similar problem was discussed here but I was not able to make my code work. The aim is to scrapy-playwright generate request-response for each URL in start_urls and parse each response the same way. ...
ReCodeRa's user avatar
1 vote
2 answers
64 views

Can't locate <a> element with all-number id attribute in Playwright ('#56' is not a valid selector)

I want to catch and locate <a> element with id attribute. Possible attributes: role href title id style onclick I can do it by role and name, but can't do it by id or onclick. The last two ...
Hayate's user avatar
  • 11

1
2 3 4 5
53