124 questions
Best practices
0
votes
3
replies
34
views
Best practice for validating form error messages across different browsers and environments in automation tests
I’m working on automating UI tests for form validations, and I’ve noticed that validation messages can differ across browsers (Chrome, Firefox, Safari), as well as between headed and headless modes, ...
0
votes
0
answers
15
views
Xray JUnit reporter is showing error "no data inside xml"
I created a custom Xray reporter that generates JUnit XML test reports. I want to upload these reports to Xray Cloud and link tests to Jira issues using the testKey property inside each <testcase&...
0
votes
0
answers
95
views
Allure Playwright not recording actions unless they are within step() or API requests
Allure reports from Playwright tests do not include actions taken outside of step() calls. For example,
step(
"Menu navigation",
() -> {
page.locator("a").filter(...
0
votes
1
answer
280
views
How to run chrome browser in headful mode in playwright-java remote server
I am using the below command to start playwright server:
npx playwright launch-server --browser "chromium"
but it is headless.
How to run it in headful mode?
I also used the below command, ...
1
vote
1
answer
86
views
onResponse handler not getting called [closed]
I've been evaluating playwright-java for a while and I've encountered an issue with regard to onResponse handler. It's simply not getting called. Documentation doesn't mention any special setup for it,...
2
votes
0
answers
312
views
How to bypass or auto-accept Chrome's file editing permission dialog triggered by window.showDirectoryPicker() in Playwright?
I trying to download a file into a folder that is not in the list of managed permissions of Playwright.
The reason I need to test this particular download is because I am dealing with a websockets ...
0
votes
1
answer
122
views
Does Java Playwright support the testing of Android devices?
I'm facing the testing of Android app (in my case with an emulated device that I already have installed on my PC) I was looking to implement it using Java Playwright.
But in their official doc, they ...
1
vote
0
answers
219
views
How to setup spring boot app with playwright docker
I have a spring boot app running in docker which have playwright code for retrieving data from some websites.
In the old form of my app arch I had my spring boot app running with selenium driver and ...
2
votes
0
answers
1k
views
Playwright tests stuck and not timing out
I'm running a lot of UI tests in a pipeline via a GitLab Runner. The test are run on VMs in the GCP in docker containers.
Most of the time this works without problems, but sporadically a job running ...
1
vote
0
answers
76
views
Playwright Java - IllegalStateException happening on waitForCondition method
I'm experiencing very weird exception while using the playwright library in java. I haven't found any information whatsoever about that exception happening in any playwright methods.
This is the ...
0
votes
1
answer
770
views
Playwright with Java - 'TargetClosedError:Target page, context or browser has been closed error
I am new to playwright and can someone help me how to resolve this error?
This is the browser initiation method in base test
public void initBrowser() {
playwright = Playwright.create();
...
1
vote
3
answers
1k
views
Playwright cannot find module './../../package.json'
I'm using playwright-java for a few months now and suddenly I got the following error:
node:internal/modules/cjs/loader:1225
const err = new Error(message);
^
Error: Cannot find ...
0
votes
0
answers
75
views
Tests not being found by runner class using Playwright and Java
I am trying to run this test and while the feature file runs. I get no tests found when using this runner class. I know the feature file and steps work since that passes but this runner does not find ...
1
vote
0
answers
267
views
Playwright java is unable to open browser in incognito window
Am sharing the snippet which i used, able to open chrome browser but not opening in incognito window.
My requirement is application under testing url must open in incognito window, complete the ...
1
vote
1
answer
2k
views
When I run multile tests in Playwright, every test after first open the browser but it doesn't open the page I think
I work as solo QA in my company and recently I started working on Playwright for test automation. After I completing each test i would run it few times just to make sure everything is working and that ...
0
votes
2
answers
2k
views
Configure Playwright to avoid browser notifications (such as "this page wants to know your location")
I'm using Playwright to analyze data from a remote site. However, at the first call to
page.goto(URL) # Initial URL
the server pops up a panel, as far as I can tell before any Javascript runs:
So ...
1
vote
1
answer
241
views
Spring Boot Maven Plugin - build docker image with custom binary dependencies
I use spring-boot-maven-plugin to build docker images.
Under the hood, this uses buildpacks (paketo). My knowledge around buildpacks is very limited.
The problem is a new requirement: we will use the ...
2
votes
0
answers
159
views
How can I force Playwright to ignore the SELENIUM_REMOTE_URL environment variable?
I have established the connection to the remote selenium greed, using SELENIUM_REMOTE_URL system environment. In this case Playwright sees this env and starts test remotelly by himself, I mean I don't ...
1
vote
0
answers
302
views
Playwright hangs forever on page.reload()
This is the Java code that is used:
public void waitForOrReload(Page page, Locator locator) {
try {
debug("waitForOrReload");
locator.waitFor(new Locator.WaitForOptions()....
1
vote
1
answer
209
views
Unable to force test timeout for Cucumber/Playwright tests ran with JUnit5
I am using Playwright in combination with Cucumber. All of my tests are ran in parallel through maven surefire with the JUnit 5 test runner. The issue I am having is that I have been unable to enforce ...
1
vote
0
answers
66
views
Clicking on a button does not always bring the same result
I'm trying to take all the colors of a product, but first I have to click on a button to show all the available ones. When I do it, sometimes it is successful, other times it just brings me the ...
0
votes
0
answers
500
views
Playwright HTTP proxy Authentication issue
I am using playwright java lib 1.44 version.
I am setting proxy url, username & password in Proxy object provided in launch options. But some how apache traffic proxy server is not able to ...
0
votes
0
answers
295
views
How to Intercept Raw WebSocket Messages or Custom Parameters in Playwright Java?
I'm currently working on a project that is extending the Playwright Java library. I need to interact with a remote service that injects custom parameters into the WebSocket communication between ...
0
votes
1
answer
593
views
While running Playwright on Selenium Grid, the file is downloaded in node machine but not showing in Selenium Grid session GET request
I am working on file downloading functionality with Playwright and Selenium Grid (in Java). Through Selenium Grid VNC, I see that the file is downloaded on my node machine.
Now I want to move the file ...
1
vote
2
answers
178
views
addLocatorHandler: iFrame cannot be found
I am currently trying to implement the addLocatorHandler from Playwright. However, with my current code, the iFrame is never found. Example code:
@BeforeClass
public void locatorHandlerTest() {
...
3
votes
1
answer
7k
views
Error while downloading Playwright browser binaries
I'm getting an error that reads "UNABLE_TO_GET_ISSUER_CERT_LOCALLY" (entire stack trace pasted below) while I'm trying to run a simple playwright code written in Java (code pasted below).
I'...
0
votes
1
answer
178
views
Not able to click the save button in the dialog box
I am doing a web automation project using NodeJS with Playwright. The project is to scrape the links and open it in new tabs and save the PDFs. I reached the last part of saving the PDFs and I am ...
0
votes
1
answer
607
views
Unable to open browser in non-incognito in Playwright
I tried this but it's not opening a browser.
Path userDataDir = Path.of("myPath");
BrowserContext BrowserContext = playwright.chromium().launchPersistentContext(userDataDir);
page = ...
0
votes
0
answers
1k
views
waitForUrl behaviour in Playwright
I am using page.waitForUrl method to wait for desired url. After clicking the submit button, I am trying to wait for url using
page.waitForURL("/my-test-url/v1/foo/") but getting time out ...
0
votes
1
answer
6k
views
Playwright - type or fill not working as expected
I am automating UI using PlayWright and Java. I have a search box in the iFrame. When I enter the text in it, I get the tool tip: Search for <number_entered> by. However, when I enter the number ...
0
votes
1
answer
741
views
How to handle multiple tabs using Playwright Java & POM and interact with elements inside the new tab
How to handle multiple tabs using Playwright Java & POM and interact with elements inside the new tab?
I am using PageBase class and here is the basic content of it
public class PageBase {
...
0
votes
0
answers
87
views
Duplicate image being generated with default name like embedded1.png when using scenario.attach() in cucumber java
I am new to Playwright and cucumber. I have setup a simple project where I am taking a screenshot of the Home Page when login is successful on a website. Screenshot is getting generated in ...
0
votes
0
answers
173
views
How do I know a Locator really points to an existing element?
I am using #playwright-java , learning by doing, first time user.
I have been attracted by the ease of use seen in the demos.
However, when facing a complex website it turns out it needs more trial&...
0
votes
2
answers
325
views
Playwright automation exception - Page.LocatorOptions().setHasText() giving 2 elements. How to identify uniquely
I am trying to select a value from an Angular dropdown using Playwright-Java. It is failing due to multiple values found. How to uniquely identify by text.
getPage().locator(obj).click();
...
3
votes
0
answers
1k
views
How to disable Automation Controlled for firefox in java Playwright
I am making an automation with playwright in Java. You will log in to accounts by going to an e-commerce site. A process repeated many times.
With Chromium, by setting the --disable-blink-features=...
0
votes
1
answer
108
views
In automated testing what is the best approach for testing each field using positive and negative tests as well?
Let's say I have a popup which has 3 fields and I have dataproviders where I provide different combinations (positive and negative) of values to fill out the popup. There is also a boolean which ...
0
votes
1
answer
379
views
How to wait for an element has text to present?
I am expecting one locator to have to value Individual. But it is taking slight delay in getting value ..
I saw this in Typescript..
const locator = page.locator('my locator')
await expect(locator)....
-1
votes
1
answer
139
views
How do I limit the number of workers in a Playwright Java project?
I now have a large number of tests that I don't want to run all in parallel, but only a certain number that has yet to be determined. How do I set this in Playwright Java?
0
votes
1
answer
2k
views
In Playwright wait for data rows to be loaded on page
I open page and waiting until data is loaded to displayed rows.
In selenium it works like this:
private final String dataRowXpath = "*//div[@ref='eCenterContainer']//div[@role='row']";
...
0
votes
0
answers
197
views
Playwright /Typescript: Unable to retrieve the Cell data from table
Playwright /Typescript: Unable to retrieve the Cell data from table:
I have a table with 10 columns and nth number of rows, each cell has different locators, my expectation is retrieve full row data ...
-1
votes
1
answer
162
views
How to share HttpSession between pages with Playwright Java
I am writing a test with Playwright, for a java application setting attributes in the user httpsession, to be shared across different pages.
The test opens the app in one page, adds an attribute to ...
3
votes
1
answer
2k
views
How to connect to remote Playwright server without creating local driver?
Assuming that Playwright server is the solution to Run Playwright Tests on unsupported Linux distributions, I want to run my Java test against a Playwright server (which is running using an official ...
0
votes
0
answers
362
views
How to use multiple storage states in different devices (browsers)
So I have spent my day banging my head against a wall trying to figure this out. What I have is a set of tests, a subset of which have to be run in 2 browsers, but the rest only need to be run in one(...
0
votes
0
answers
40
views
maven-surefire-plugin: How do I get rid of individual columns in the xml report?
My goal is to have this tag in the XML generated by surefire:
<testcase name="NameMyTest">
For this, I used the line
@DisplayName("NameMyTest")
in my Playwright Java test ...
0
votes
0
answers
123
views
For automating a desktop eCommerce site running on mobile device as a mobileweb app, is Playwright a reasonable choice?
At our client, they have an eCommerce website made of node.js, vue.js etc., which implements their SAP (ERP) backed processes. Customers use both desktop and mobile devices to create orders.
WorkSoft ...
2
votes
0
answers
338
views
Can't add Playwright to a Dockerized Java app
I have a spring app that runs with the following dockerfile (used for Tilt locally):
FROM amazoncorretto:21-alpine-jdk AS builder
# Install "entr" package using apk package manager
RUN apk ...
0
votes
0
answers
119
views
Not able to run scripts on Azure ADO pipeline getting failed to create driver exception on local it is working fine, issue on pipeline only
I am getting this below exception when I run pipeline on azure ado and automation tool is playwright
> Task :testJsonConfig
[gradle]: java.lang.RuntimeException: Failed to create driver
[gradle]: ...
0
votes
0
answers
864
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
...
0
votes
1
answer
267
views
Is there a method to drop the .har file?
My Playwright test is in a Junit5 tests. What I am trying to achieve is that, if there is any assertion on my test (basically if the test fails), save the .har file, otherwise discard it.
@Test
...
0
votes
1
answer
2k
views
Maven Surefire Not Running Tests in Suite - Tests Detected as Zero
I am experiencing an issue with Maven's Surefire plugin in my test automation project. When I run individual test classes using mvn test -Dtest=TestClass, it works fine. However, executing my test ...