'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 following:
page.waitForFunction(() => page.evaluate("document.readyState").equals("complete"));
But syntactically that is incorrect or maybe I'm doing something wrong.
Solution 1:[1]
You have to pass a string to the waitForFunction
page.waitForFunction("() => page.evaluate('document.readyState').equals('complete')");
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | hardkoded |
