For questions about the Playwright API for Java. This tag should be used in conjunction with the [playwright] tag.
Questions tagged [playwright-java]
83 questions
4
votes
5 answers
Wait for network idle after click
I'm looking for a method that would allow me to wait for the network idle after clicking a button or some action.
there is a way to wait for the network idle after clicking?
page.locator("text=Click").click() //some method that wait network is idle…

Vladislav Belousov
- 41
- 1
- 2
4
votes
2 answers
PlayWright Azure Pipeline Error: browsertype.launch: executable doesn't exist at /home/vsts/.cache/ms-playwright/chromium-965416/chrome-linux/chrome
When I try to execute playwright scripts in Azure pipeline using YML file, I am getting the below error:
browserType.launch: Executable doesn't exist at…

Jack Vicky
- 81
- 1
- 5
3
votes
4 answers
Playwright JAVA: How to get the VALUE of an input field
Hello Playwright experts,
I have this input field
I have tried this JAVA code:
page.locator("[placeholder=\"e.g. Max\"]").textContent();
It does not work :-( but I can…

lorenlai
- 51
- 7
3
votes
1 answer
How can I check if a response has already been received for Playwright?
Using Java, I'm trying to wait for a response to one of the Javascript scripts I'm waiting for.
I've already discovered that I can use waitForResponse, but this leads to issues if the script has already completed loading before I reach the…

aproxx
- 33
- 2
3
votes
0 answers
How can I mock API response to login in Playwright testing?
I'm really new to playwright and I wish to skip the authentication part for a certain internal website. This authentication requires OTP login and I have tried all the solutions that could have worked I found through youtube or research.
This is my…

Aman Sinha
- 99
- 1
- 9
2
votes
1 answer
Unable to run Playwright project on Ubuntu 20.04 server
I'm able to run my project on my pc, and another place.
But when I try to deploy it production it just breaks.
I get following issues:
java.lang.RuntimeException: Failed to create driver
at…

Immutable
- 75
- 1
- 7
2
votes
0 answers
How to disable chrome pdf viewer in new tab with java in playwright
I'm trying to disable the pdf viewer in a new tab when I use chromium in Playwright. Do you know how can achieve that? Firefox has a method, it's called .setFirefoxUserPrefs().
For chrome, it's not implemented, but found the following…

Angel Dayredzhiev
- 21
- 2
2
votes
1 answer
Using Multiple tags to run playwright tests in Gitlab
I have a large number of tests, all tagged with relevant tags. If I want to run a number of different tags in the same run, locally, I use
npx playwright test -g 'tag1 | tag2 | tag3'
and that works and runs all tests tagged with tag1, tag2, or…

Dan Walker
- 63
- 4
2
votes
0 answers
How to get an api get request's query parameter using Playwright-Java
Context :
Trying to intercept and Replace a browser get request's query string parameters using playwright java.
I am able to print the URL of the get request along with the query string parameters using page.onRequest
Issue:
Please help me find a…

jba065
- 189
- 1
- 4
- 10
2
votes
0 answers
Using Playwright in a modular Java application
I would like to use the Playwright library in my modular Java application.
This is my main class:
package group.test;
import com.microsoft.playwright.Browser;
import com.microsoft.playwright.Page;
import com.microsoft.playwright.Playwright;
public…

nistel
- 113
- 7
2
votes
2 answers
How to set proxy for Chromium on Windows with Playwright Java?
I'm trying to use a proxy for Chromium on Windows:
BrowserType.LaunchOptions launchOptions = new BrowserType.LaunchOptions();
launchOptions.setProxy(new Proxy("localhost:8888"));
Browser browser =…

Christian Baumann
- 3,188
- 3
- 20
- 37
1
vote
2 answers
What's difference between page.querySelector() and page.locator() Playwright?
I started learning about Playwright Java. The code below I used page.querySelector().getAttribute() and page.locator().getAttribute() to get the path of the same image. They return the same string img/logos/Browsers.png.
What is the difference…

Kepler452B
- 130
- 1
- 1
- 9
1
vote
1 answer
How to get the latest Page Value for the iTestContext attributes in Playwright Java (By Overriding)
Overview
Hi In ItestContexts.setAttribute() the method Page Object does not get overridden by the new pages created , I want to dynamically update the the page value in ItestContext on run time
Question
I'm using Playwright with Java to develop a…

Kasun Herath
- 15
- 3
1
vote
0 answers
Playwright-java with Pdf - doesn't wait for login
I want to generate a pdf using the playwright java, the problem is the page I want to generate pdf is not directly available on the main page or landing page after login. So I tried to log in one tab and load the URL which I wanted to generate the…

user3132347
- 363
- 1
- 7
- 27
1
vote
3 answers
Strict mode violation Error happens when I try select an option which is a substring of another option
First off, I want to tell you that I am new to this playwright tool. My problem is, I have two option male and female when I try to click male option in the list using the following code,
page.getByRole(AriaRole.LISTITEM).filter(new…

Rajagopalan
- 5,465
- 2
- 11
- 29