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

Page.locator Playwright

I would like to find a way to get the element from a Text with locator I try to use await page.locator(f'td:below(:text("{name}"))').first_text_content() below the name on site, the first element is what i want, but when i use the function it…
0
votes
0 answers

How to get the html from the Elements tab in Chrome's devtools?

I have a website that I'm testing. It works nicely in Chrome and I can inspect the HTML with Chrome's developer tools. When I load the page with playwright I get a correct screenshot but the HTML does not contain the content. I added a 10 sec wait…
chhenning
  • 2,017
  • 3
  • 26
  • 44
0
votes
3 answers

What is the Playwright equivalent of Selenium's ExecuteScript function?

In Selenium (c#), you can use an IJavaScriptExecutor to execute javascript commands on IWebElements you find, using the arguments[index] string in your script. For example, if I want to use javascript to click on an element, I could use the…
Josh Heaps
  • 296
  • 2
  • 13
0
votes
2 answers

Getting inconsistent results for border-bottom-color with Playwright

I'm new to Playwright and trying to verify that, on hover, the border-bottom-color is set to a specific rba value. This is the element style that is applied on hover as seen in the browser dev tools: . However, when I run the test I keep getting…
devlife
  • 15,275
  • 27
  • 77
  • 131
0
votes
1 answer

how do i click the second list item(li) inside the second unordered list(ul)?

This is the footer element of web that I want to test.
0
votes
1 answer

Playwright times out in while-loop

I am using Playwright with Python to scrape data from an apartment leasing website. The following code handles a pop-up in a while-loop that appears only when an availability date for that unit is some time in the future and asks to "Change Desired…
iron502
  • 47
  • 7
0
votes
0 answers

Compiling error importing Crawlee in react

I'm trying to integrate the crawlee library (https://crawlee.dev) inside my react app for a social scrape project, but as soon as I import the PlaywrightCrawler module I get the following compile error: ERROR in…
0
votes
1 answer

Nuxt 3 project has a vitest and a playwright testing library to test. But running the vitest script also runs on the playwright test files

I have a Nuxt 3 + VueJS 3 project. My package.json is as below: { "scripts": { "build": "nuxt build", "dev": "nuxt dev", "generate": "nuxt generate", "preview": "nuxt preview", "postinstall": "nuxt prepare", "prepare":…
myverdict
  • 622
  • 8
  • 24
0
votes
0 answers

Installation of PlayWright with C#

I ran this command to set up playwright: "dotnet add package Microsoft.Playwright.MSTest" Getting below error: Can anyone hlep How to solve…
0
votes
0 answers

Python and Playwright - Triggering dom xss

I'm using python and playwright for triggering domxss. Code: import asyncio from playwright.async_api import async_playwright async def main(): async with async_playwright() as p: browser = await p.chromium.launch(headless=False) …
Senad
  • 1
  • 1
0
votes
0 answers

Making horizontal swipe in Playwright with Tab (HeadlessUI NextJs)

Hi I'm fairly new to e2e testing so one of the features I wanna test for mobile version in Playwright is horizontal swiping. On the mobile version I only have 1 product image displayed and user on mobile can swipe right to check other images of that…
Vedo
  • 976
  • 4
  • 21
0
votes
0 answers

Playwright fail to authenticate using storage state. Firebase token

I am setting up Playwright framework from the scratch and trying to reuse authentification with the help of storage state and I faced an issue when my tests fail trying to authentificate. There is a setup file with login, retrieving and preserving…
Lubo
  • 45
  • 3
0
votes
1 answer

Order of instantiation of test hooks in flaky playwright tests

The layout of my test is something like test.describe("...", () => { let p: Page; test.beforeEach(async({browser}) => { p = await (await browser.newContext()).newPage(); } test(...); test(...); test.afterEach(() => { …
lef
  • 67
  • 4
0
votes
1 answer

Check autofilled value with Playwright

I am testing with Playwright and faced one problem. On web I've a form with 4 fields. When 2 of them are filled, in third one appears calculated value. Expect.soft returns on this new appeared value received string: "" As example I've this part of…
0
votes
1 answer

Playwright & CucumberJS - Trouble awaiting for page to load in chromium

So I followed this guide to starting Playwright with Cucumber-JS and instead pointed to my company's website; however, the page never seems to load, even if I set the timeout to something ridiculous (like 1,000,000 ms) I don't know why my page never…
Raisus
  • 148
  • 3
  • 23