Questions tagged [playwright-java]

For questions about the Playwright API for Java. This tag should be used in conjunction with the [playwright] tag.

83 questions
1
vote
1 answer

Locally convertig HTML to PDF with playwright

I've got an spring boot application which uses wkthmltopdf to convert a HTML-file, which is generated during runtime by thymeleaf template engine, to PDF. String html = templateEngine.process("template.html", webCtx); // html file generated from…
Theiaz
  • 568
  • 6
  • 24
1
vote
0 answers

playwright Chromium browser not installed in heroku platform while deploying meteor app

We are deploying meteor app with nodejs in heroku platform. meteor@1.9.2 Nodejs@1.14.1 Playwright@1.14.0 https://github.com/playwright-community/heroku-playwright-buildpack.git https://github.com/sunny/chromium-buildpack.git After deploying the app…
1
vote
2 answers

How to record video of tests with custom file name as test method name in playwright java and testng framework

I have test class defined as this- public class Sample extends BaseTest { private LoginPage loginPage; @Override public void initialize() { loginPage = createInstance(LoginPage.class) browserContext = getBrowserContext(); } @Test(testName =…
Rajeev Dixit
  • 1,533
  • 2
  • 16
  • 25
1
vote
1 answer

Why does Playwright's generated Java code have invalid syntax?

When I use the Playwright's codegen feature it traces my clickpath into a Java file. But the created file has the wrong syntax, so I can't compile it. I start the codegen with: mvn exec:java -e -Dexec.mainClass=com.microsoft.playwright.CLI…
CampingCow
  • 120
  • 10
1
vote
1 answer

Java : Playwright, rename an Action for trace viewer

I am using the Playwright library to create a program that executes a navigation in a web application by interacting in different ways/actions, with the browser interface. The main purpose of my project is to monitor and gather information about the…
binaryRat
  • 186
  • 1
  • 11
1
vote
1 answer

How to set source root directory via PLAYWRIGHT_JAVA_SRC environment variable when source collection is enabled

I'm trying to run my first Playwright trace using java and i'm getting below error, I'm not sure what i'm missing out and I'm running mu code in Intlij Playwright playwright = Playwright.create(); Browser browser =…
Deepak_Mahalingam
  • 454
  • 1
  • 9
  • 21
1
vote
0 answers

Playwright with Groovy gives type error on BrowserContext.setDefaultTimeout

I'm trying to set a timeout for Playwright. The API docs say BrowserContext.setDefaultTimeout(timeout) takes a double as timeout. My code: import com.microsoft.playwright.Browser import com.microsoft.playwright.BrowserContext import…
ou_ryperd
  • 2,037
  • 2
  • 18
  • 23
1
vote
1 answer

playwright how to get a response from a page after navigating and logging in

I looking at playwright and I want to return a response I have looked at the examples and there is the following snippit Response resp = page.navigate(getPageRequest.getUrl(), new Page.NavigateOptions().setTimeout(60000)); But what I want to do is…
Tony
  • 363
  • 3
  • 17
1
vote
1 answer

Java playwright usage of page.waitForFunction()

I am trying to figure out how to use the page.waitForFunction() in Playwright in Java. I would like for a page.evaluate() to run first, and for the page.waitForFunction() to wait on it, before continuing. I have the…
adbarads
  • 1,253
  • 2
  • 20
  • 43
1
vote
0 answers

How can I get a session ID?

In Selenium for Java I can call RemoteWebDriver.getSessionId() to get the GUID associated with my browser session. How can I get the session ID in Playwright? I've looked at the members of any seemingly relevant object (Browser, Page, Context, etc.)…
Ryan Lundy
  • 204,559
  • 37
  • 180
  • 211
0
votes
0 answers

Verify text on page without locator

I am using playwright, working with an ERP (IFS) system and I can't figure out the locator for my text on page to be verified. How can we verify the text on a page without locator? I tried the…
Sara
  • 181
  • 1
  • 3
  • 16
0
votes
0 answers

PlaywrightJava: Failed to create driver when adding playwright via target Plattfrom

I added Playwright via Target Plattform -> m2e PDE Integration to my Plugin Project (Is there a better way of Integration?). Playwright.create() throws the error: Failed to create driver java.lang.RuntimeException: Failed to create driver at…
umpapa
  • 55
  • 1
  • 8
0
votes
1 answer

Playwright connection closed when executing the test

I'm creating a framework with Playwright, Java and testNG. I'm initialising driver class where the browser is initialised and have wrapper methods where the playwright functions are defined. In test class where the test is triggered. I'm getting…
0
votes
0 answers

How to extract the exact request with payload and URL in Playwright Java

I sent a post request with a payload as per below, and when I printed requestContext, its value was com.microsoft.playwright.impl.APIRequestContextImpl@771a660. I just want to print exact request with payload , for tracking purposes. import…
Sameera De Silva
  • 1,722
  • 1
  • 22
  • 41
0
votes
2 answers

Unable to click on Next button after checking the checkbox

I have a checkbox and next button below it. private String CHECKBOX = "[data-testid='checkbox_with_label']"; private String NEXT_BTN = "//button[@data-testid=\"next-button\"]/div"; I am checking the checkbox and then clicking on the Next button,…
rupam
  • 3
  • 1