Issue
I need to translate Selenium code into Playwright.
code:
self.wait_for_element_not_present("element CSS here")
Is the solution:
Not self.page.locator("element CSS here").is_visible()
Solution
You can use the not_be_visible expect assertion for this.
expect('element CSS here').not_to_be_visible()
By default expect assertions have a 5 second timeout, in case you want to increase the timeout, you can do like this:
expect('element CSS here').not_to_be_visible(timeout=7000)
Answered By - Alapan Das
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.