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.
1,734
questions
0
votes
0
answers
6
views
Playwright seems unable to play songs on spotify web
I've accessed the spotify website (open.spotify.com) through playwright fine, but when i manually navigate around trying to play a song and click play nothing happens. I've tried both Firefox and ...
0
votes
0
answers
10
views
CI/CD with Github Workflow, Webpack, Playwright for e2e and deploy to dedicated server
We are setting up GitHub CI (Frontend) environment for our customer. I wonder if anyone faced the same problem with setup of a huge SPA project.
Frontend stack is: typescript, vuejs, webpack dev ...
0
votes
0
answers
5
views
Import needs to have explicit .ts if file is being imported other than from /src/lib in Sveltekit
I'm trying to write some tests using Playwright inside /tests folder.
I'd like to use some helper functions which I could put under /tests/lib/helpers.
Tests throws module not found error if .ts ...
0
votes
0
answers
10
views
Running a Playwright Test that interacts with Maptile Headless, when running headless the map does not render
When running a Playwright Test that interacts with a page with Maptiles in a Headless browser, the map does not render
I've tried these without any success
passing --no-sandbox to chrome
passing --...
0
votes
1
answer
16
views
Why playwright miss pattern url?
I need to handle request with certain url and im trying to do it like this:
await page.route("**/api/common/v1/play?**", handle_data_route)
But it also handles a url like this: api/common/...
0
votes
0
answers
9
views
Reuse log in state for all tests with pytest-playwright and Django
I'm trying to create a pytest fixture that will allow all my tests to reuse a single authenticated context. The goal is for the fixture to run once, yielding a context. Then the other tests can just ...
0
votes
1
answer
44
views
"ModuleNotFoundError: No module named 'pyee.asyncio'" on playwright
This is my environment:
ubuntu18.04(wsl2)
playwright 1.29.1
pyee 8.22
scrapy-playwright 0.024
Here is my code:
import asyncio
from playwright.async_api import async_playwright
import time
async def ...
0
votes
0
answers
8
views
[Playwright]Is there any way to turn “Chrome automated test”off? I'm afraid the website detected this and blocked me
[Playwright]Is there any way to turn “Chrome automated test”off? I'm afraid the website detected this and blocked me.
I’m using playwright.chromium.launch_persistent_context()
This is what I want to ...
1
vote
0
answers
21
views
Is it possible to call on a javascript file from a bash file using playwright? [closed]
I'm leveraging the automation tool Playwright. I'm running into an issue where I'm trying run a bash file to open an authenticated org and then using "require" to call on a js file from ...
0
votes
1
answer
10
views
Cannot automate Playwright tests with GitHub authentication - prompted to email code verification
I'm writing automation tests for my web application. One of the step is to complete authentication in my app. To do so, there is a button for GitHub authentication. I'm using GitHub OAuth app.
When my ...
0
votes
1
answer
24
views
Cannot access element in Playwright global setup script
I'm trying to use Playwright to automate authentication in my web application.
When I did the authentication test in a typical .spec.ts file, it succeeded:
test('bnblnlnnl', async ({ page }) => ...
0
votes
0
answers
11
views
How to run Playwright Inspector inside WSL2?
I have Playwright running inside WSL2 on Windows 10. WSL is configured to work with GUI apps. Opening browsers is fine, but when starting with Playwright Inspector
# npx playwright codegen google.de -...
0
votes
0
answers
11
views
Page reuse Playwright Java for PowerApps Testing
I want to reuse a page using Playwright with Java so I speed up the running of tests.
I use a persistent context because of the login requirements on the project - organisation page and MFA. I tried ...
0
votes
0
answers
14
views
Do not open Developer Tools when browser opens
When I run my tests, the Developer Tools panel is automatically open. Can I close it using Playwright? I don't need to see it.
0
votes
1
answer
18
views
Why when installing cron along with playwright,errors occur in the absence of the playwright module
The launch takes place on a VPS. So, if you run the code without cron-a, then everything is OK, the sites are parsed. When I add cron, everything flies into a heap with errors. Here is what my log ...
0
votes
0
answers
17
views
Block Pop Ups (chrome) in Playwright configuration (python)
Having difficulty trying to configure a Playwright test to block pop ups in Chrome. The python tests points to a site which a pop up automatically occurs for Microsoft Authentication (username and ...
0
votes
1
answer
50
views
How to prevent an HTML5 video from rendering but still have it register as being actively viewed
I want to make my browser (chrome preferably) not render HTML5 videos in order to save on GPU/CPU resources while still having the video count as being actively played, having its sound work, the ...
0
votes
0
answers
19
views
Pulling a value from website and returning it
Hi I'm new to using playwright. Essentially at the end of and end to end checkout test I want to use console.log(VALUE) with the value being the order number that is displayed on the thanks page of ...
1
vote
1
answer
61
views
How to cancel kotlin coroutine with potentially "un-cancellable" method call inside it?
I have this piece of code:
// this method is used to evaluate the input string, and it returns evaluation result in string format
fun process(input: String): String {
val timeoutMillis = 5000L
...
0
votes
0
answers
10
views
How can I merge coverage reports from jest and playwright using nyc without getting wrong results for functions?
In the project I use playwright to test most of the code. I added jest to test some specific util stuff directly. Playwright and jest generate a json test coverage report which I want to combine to ...
0
votes
0
answers
19
views
Playwright slowMo Causing Inconsistencies
My playwright tests are taking the maximum slowMo time to execute certain steps but still execute them. EG:
page.evaluate
elementhandle.innertext
Our playwright.properties file is set to 500ms -
...
-1
votes
0
answers
13
views
can we change snapshots name using toHavesnapshot() function
i want save snapshot with custom name but snapshot given default name suppose i want save the image name xyz.png but toHaveSnapShot()function save the name xyz-win32.png.
but I don't want save xyz-...
1
vote
1
answer
32
views
Playwright-Getting text from locator element
I am trying to grab just the order number in the h1
<h1 class="FulfillmentHeaderstyles__FulfillmentHeaderTitle-sc-1ges29w-3 PjsJX">
Order #1004066
<div aria-label="...
0
votes
1
answer
19
views
Playwright retry on actions
I have a scenario here:
Click element A (a button), trigger element B (say, a div) to appear. However due to multiple factors, clicking might fail to trigger the event. The reason could be clicking ...
0
votes
0
answers
17
views
In Allure Cucumber report time taken is getting added along with expected & actual
In Allure Cucumber report when we are using assertion in the report along with the logs time taken is getting appended. How to avoid this? I just need the expected & actual values to be displayed
...
-2
votes
1
answer
26
views
Playwright Logical expect
I have two headings on the page and I need to make sure that either the one or the other exists in the page.
let heading = page.getByRole('heading', {name: 'MyFirstHeading'});
let heading2 = page....
0
votes
1
answer
35
views
Playwright: Possible to specify either number of workers or the browser for 1 test only?
I have my suite set up to run against 4 browsers using 3 workers (2 desktops and 2 mobile) I have a test that I need to either not run in parallel or limit to just run in one desktop browser.
Is that ...
0
votes
1
answer
21
views
what's difference between page.locator("xx",has=Locator) and page.locator("xx").filter(has=Locator) in Playwright
HTML like:
<ul>
<li>
<h3>Product 1</h3>
<button class="button">Add to cart</button>
</li>
<li>
<h3>Product 2</h3>...
0
votes
0
answers
19
views
Scrape text with playwright is slow using locator
I'm try to use Playwright to scrape some cities using nodejs. I call locator method about 300 times with different selectors with code like this:
const finishedAds = await page.locator('div.iva-item-...
-1
votes
0
answers
47
views
Unable to run playwright script in taskscheduler
I have wrote a script in playwright i made a .bat file to run it when i run it manually the script runs and works perfectly but i want to automate the entireprocess to run each day morning
I tried to ...
0
votes
0
answers
31
views
Playwright: unable to login via API setting cookie (able to do it with Cypress)
I'm trying to implemented login via API following Playwright's guidelines but somehow nothing seems to be working.
As a comparison I've built the same in Cypress and it works out of the box:
Context:
...
-2
votes
0
answers
25
views
playwright error (1 required positional argument: 'impl_obj' ) not going away
this is my code programed to run at a specific time
import datetime
from datetime import timedelta
from apscheduler.schedulers.background import BackgroundScheduler
from playwright.sync_api import ...
0
votes
0
answers
16
views
How to generate allure report for cucumber js on playwright?
I can not generate allure report for executed features
My package json looks next:
{
"author": "Lorem ipsum",
"description": "Playwright end-to-end test ...
0
votes
0
answers
35
views
How to swipe color picker button to right using dispatchEvents?
I tried to swipe color picker button to right but didn't worked. How to swipe color picker button to right using dispatchEvents?
Tried below code;
page.locater(".hue-horizontal div:nth-child(2) ...
1
vote
1
answer
20
views
How to avoid that Playwright ignore multiple key press
I have a test that is structured as follows.
1. Press Enter 10x.
2. check that element XYZ is in focus.
The keyboard.press is inside a for loop.
The problem is that due to the press speed, the ...
0
votes
0
answers
18
views
Cannot open new tab in the same context in Playwright (c#)
I'm trying to open new tab in the same browser session and switch context to it.
When I do it with following code:
await BrowserSession.Browser.Contexts[0].NewPageAsync();
I got the error: Please use ...
0
votes
0
answers
25
views
failing to import code from a different file playwright?
current goal is to import code from 1 file and run it in another but i getting this error
Job "runF5 (trigger: interval[1 day, 0:00:00], next run at: 2023-01-31 00:24:00 PKT)" raised an ...
0
votes
1
answer
19
views
Playwright & Vite - test block cannot find an element, although exists
I'm running some e2e tests with playwright with vite frontend application.
This is my code:
import { test, expect } from '@playwright/test';
test.describe('Auth page @auth-page', () => {
test('...
0
votes
2
answers
40
views
can we use the toHaveScreenshot() and toMatchSnaphot() out side the test
Can we use the toHaveScreenshot() and toMatchSnaphot() outside the test without using config file only simple install NPM i playwright in package.json
I have already one snapshot I want to compare ...
0
votes
0
answers
10
views
how to integrate ngx-logger into playwright
I'm new in TS & angular. Now I have a legacy playwright project, which I'd like to use ngx-logger for logging.
According to many ngx-logger tutorials, I know there might be 3 steps to integrate:
...
0
votes
0
answers
17
views
Playwright & Javascript - Variable inside of has-text locator not functioning
I am attempting to use a variable inside of a has-text locator to click the selected Country from a dropdown webpage button element.
My code is:
const dropdown = page.locator(".ta-results")...
0
votes
0
answers
26
views
How to Implement Angular web app healthcheck service? [closed]
We have an Angular web app (with a backend in Java SpringBoot).
Need to build a health check service, which tests that all its services are up and working and shows the status to the users.
Is it ...
0
votes
0
answers
44
views
locator.click: Error while parsing selector
I am seeing Error: locator.click: Error while parsing selector 'link', { name: 'Login' } - unexpected symbol "'" at position 0
locator.js
export const loginTab = "'link', { name: 'Login'...
0
votes
0
answers
44
views
Playwright error: browserType.launch: Timeout 180000ms exceeded at Object.playwrightFixtures.browser.scope [as fn]
Version: "@playwright/test": "^1.29.2"
Browser: Microsoft Edge
Has anyone else also faced similar issue before? I'm getting below error,
"browserType.launch: Timeout 180000ms ...
0
votes
0
answers
20
views
Playwright JUnit report add name attribute to testsuites tag
I am looking for a way to set the name attribute for the <testsuites> tag.
With the standard settings for the JUnit reporter, the testsuites tag looks like this:
<testsuites id="" ...
0
votes
1
answer
14
views
How to have playwright workers execute separate logical paths in an NUnit test?
I have a Playwright test which I'm running via the following command -
dotnet test -- NUnit.NumberOfTestWorkers=2
From what I can gather, this will execute the same test in parallel with 2 workers. I'...
0
votes
0
answers
16
views
Error running npx playwright codegen in VScode without internet access
Im getting the following error when running running npx playwright codegen in VScode without internet access. I believe I have all extensions installed.
[~home]$ npx playwright codegen
npm ERR! code ...
0
votes
0
answers
37
views
Pycharm JavaScript heap out of memory on Unbuntu
Extracting data from multiple urls using scrapy-playwright leads to following error after parsing about 1000 urls.
FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
I ...
2
votes
1
answer
27
views
Cannot use PerformanceObserver in Cypress
Is the a way to use the PerformanceObserver in Cypress?
For me, it does not seem to fire.
I have done it in playwright
const { chromium } = require('playwright')
(async () => {
const browser = ...
1
vote
1
answer
35
views
Get tab name in Chrome with Playwright
I am trying to fetch the tab name with playwright, but my code only outputs the page url.
For instance, I want to go to https://www.rottentomatoes.com/ and print the name being shown on the tab:
...