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.

Resources

2380 questions
0
votes
0 answers

Hook the document.cookie using stack trace/error trace in javascript

I'm trying to write code to hook the dcument.cookie (both write and read property) and the corresponding scripts and script URLs by using the call stack trace or error stack facility of javascript but I'm unable to get it, not sure what I'm doing…
ZA09
  • 71
  • 6
0
votes
1 answer

Result of Expect(locator)

I am learning Playwrignt for C# How can I get the result of await Expect(locator).ToHaveValueAsync(value) something like true or false?
0
votes
1 answer

How to pass a value to a test from beforeeach

I am writing a test in playwrite and have a before each. I need a value that is generated in the beforeEach function to be available in the test function itself. test.beforeEach(async ({ page, request }) => { const user = await…
Matt
  • 487
  • 1
  • 6
  • 16
0
votes
0 answers

How do I enable the "Chrome is being controlled by automated test software" web driver notification in Python Playwright?

I'm using Playwright and I'm trying to automatically navigate to a web page, but I don't see the Chrome notification "Chrome is being controlled by automated testing software" every time I run the program. How do I enable this notification? Python…
0
votes
1 answer

Playwright: pass open context/page to globalTeardown

Here is my scenario: testfile1 containing some tests testfile2 containing some tests ... testfileN containing some tests I log into application in global-setup (using storageState as defined in docs -…
KJ1
  • 13
  • 3
0
votes
1 answer

Playwright - receiving error 'locator.click: Target page, context or browser has been closed' between test run

I am running a set of Playwright tests against Chromium (in Visual Studio Code). When running the tests individually, they all pass. However running together (simple npx playwright test), each test that runs after a successful test, will fail with…
dogowar
  • 41
  • 1
  • 8
0
votes
0 answers

Why can't I use fill and type methods in playwright inspector on input elements?

It does not matter if I try type or fill on the element using the playwright inspector console, it shows the error as below: playwright.$("//app-date-picker[@formcontrolname='myDate']//input").fill('a2'); VM51594:1 Uncaught TypeError:…
L. Measy
  • 1
  • 1
0
votes
0 answers

Playwtight JS and QASE. How check the steps?

I use plugin playwright-qase-reporter Case contains some steps. How can I check it? test.describe('Test suite', () => { test(qase(4, 'Several ids'), () => { // its case //here need check the step of test case …
0
votes
1 answer

Playwrigth: Can't set cookies in the context

I'm trying to set some cookies using a globalSetup in Playwright However If I go to the network tab when debugging using the npx playwright test --headed option to run tests, the cookies are not present. The globalSetup is invoked and the cookies in…
Fer Toasted
  • 1,274
  • 1
  • 11
  • 27
0
votes
0 answers

How can I get past recaptcha with Playwright for node.js/typescript and pnpm?

I'm trying to submit a form with recaptcha in Playwright using node.js/typescript and pnpm. However, when the form is submitted, I get a recaptcha error message. Is there a way to solve this? I found and tried…
devlife
  • 15,275
  • 27
  • 77
  • 131
0
votes
0 answers

Python BrowserContext.pages list length mismatch when clicked link opens in new tab?

I'm new to Playwright so expect this is my misunderstanding, but any help gratefully received. When using Python Playwright (1.31.1) to click a link on a page which opens a new page in a new tab, I'd assumed the list length returned by…
COB
  • 1
0
votes
0 answers

Wait till page is submitted and reloaded in Playwright

I'm using playwright 1.32 against a web application developed with Oracle Apex 20.2. I'm writing a dummy test (see below) just to learn how to control if the error message is shown, to make the test fail: This is the result of bellow code. The…
0
votes
1 answer

How to copy the src URL inside the iframe, change it and navigate to the updated URL

How to copy the src URL inside the iframe, change it and navigate to the updated URL iframe class="Hkk469u_YqP_JeDapvYp"…
Niro
  • 9
  • 2
0
votes
1 answer

Playwright locator is reassigned after click()

I am getting some strange behavior with the .click() method in a large application built using the angular framework. When I first click on the locator assigned to next_button the correct button is clicked during the test. The second click on…
Jerry Pass
  • 105
  • 12
0
votes
1 answer

Using same locator on different pages (Python)

I'm doing something like this: await PAGE1.get_by_role("button", name="mono").nth(3).click() await PAGE2.get_by_role("button", name="mono").nth(3).click() I've been trying to figure out if there was a way to set up a locator, so I can just…
arjepsen
  • 11
  • 1