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
1 answer

How can I locate a link that is a child of the following sibling?

I have to colour an element after the selection, the element which i would like to colour is found as a child of the following sibling. I have successfully located the element using the following code page.getByRole(AriaRole.COMBOBOX, new…
Rajagopalan
  • 5,465
  • 2
  • 11
  • 29
0
votes
1 answer

Square brackets property accessor doesn't work in evaluate method [Playwright]

I'm trying to get a property value of web element, setting property name dynamically. Each time, when I use square brackets property accessor (Ex: node[propertyName]), I get an error "elementHandle.evaluate: ReferenceError: propertyName is not…
0
votes
2 answers

playwright what is the best practice to test localisation

I am learning playwright and it highly recommends to use customer facing selectors... so that rises a question what is the best approach for localisation testing. I am using https://practice.automationbro.com/ to practice and unfortunately it does…
0
votes
1 answer

How to log the json response body in playwright after a button click?

I am trying to log the response body from an api call that is initiated by a button click in playwright. I have been at this for a while, with no results. I can log the response status, request headers and response headers, But not the response.…
Adam
  • 3
  • 1
  • 3
0
votes
1 answer

Playwright => Allow all cookies automatically

I'm writing a Python script using playwright. I would like to allow the cookies before taking the associated snapshot of any website. Do you know how to handle this ? Thank you !
0
votes
2 answers

How to validate API response schema in Playwright using TypeScript

I am new to Playwright. I am writing API tests in TypeScript where my API response is like below: { "id" : "abc123", "appCode" : "09000007", "applicationReference" : "ABCDEF", "datetimeSubmitted" : "2023-03-09T17:56:28.912876Z", …
Sweety
  • 117
  • 6
  • 18
0
votes
1 answer

Run some action as soon as any page loaded in Playwright

I want to run some actions as soon as any page is loaded in Playwright (in library mode): load page A run common post-load actions <--- run specific actions for page A load page B run common post-load actions <--- run…
lonix
  • 14,255
  • 23
  • 85
  • 176
0
votes
0 answers

How to call state object from different file?

My setup file runs at first before all tests. After the setup is finished, the system moves on to other tests(using axios in api tests). I m setting response.token to LoginState.authUber(in state.ts). But main problem is here into to axios.ts file,…
YusufOzt
  • 27
  • 8
0
votes
1 answer

Headless mode and HTML report generation causing playwright test failures on AWS CodeBuild

I have successfully hosted my Playwright tests on AWS CodeBuild, and the report is generated as expected when all test cases pass. However, if any test case fails, the build fails and throws an error. The error message reads: Serving HTML report at…
0
votes
0 answers

How to select a element based on text from other class using playwright

I need help in traversing the element to check whether a radio button is enabled or not. Below is the sample structure looks like. I need to locate the radio button class which has text playwright.
0
votes
0 answers

Is there a way to return accurate api response time?

After navigating to a page, how can I get the response time of 10 APIs that would have been called? I want the time to be accurate as shown in the network tab- to test the performance sanity. enter image description here I have tried the…
IAmAnil
  • 1
  • 2
0
votes
1 answer

running PlayWright headed test on dockerized ubuntu with gui

I am trying to run a test with headed mode on ubuntu with GUI on docker container. I have created an image that's creating a docker image with GUI + VNC so i will able to watch it. Dockerfile: # Pull base image. FROM ubuntu RUN apt-get update #…
Itzik.B
  • 1,023
  • 2
  • 15
  • 35
0
votes
0 answers

Playwright: Capturing Redirects When New Tab is Opened

I am using Playwright in Python to collect data from some websites. As part of my instrumentation, I am clicking certain elements on the webpage. Some of these open up a new tab and after multiple redirects reach a final landing page. I want to…
0
votes
1 answer

Playwright: expect.toHaveAttribute: Unsupported token "@xpath" while parsing selector

In Playwright I created a script to verify the title using toHaveAttribute assertion for this element: Unient | Your Versatile Partner for Better Offshoring Here is my code: import { test, expect } from…
Sarah G
  • 21
  • 10
0
votes
1 answer

Using variables in URL validation

I'm trying to use a variable in the URL assertion but not having any luck. const LAST = page.locator('#Selector1'); const LastResult = page.locator('#Selector2').textContent(); await page.goto(Env.baseUrl + '/Search'); await…
DgutOrig
  • 1
  • 1
1 2 3
99
100