-
Notifications
You must be signed in to change notification settings - Fork 0
WaitElementVanish.cs
Avrigeanu Laurian edited this page Apr 11, 2023
·
1 revision
Waits for the first element in the current page that matches the specified selector to vanish, and returns null
.
-
selector
: A selector that identifies the element to be found. -
retries
: An integer indicating the number of times to retry the wait if the element is still present. Each retry waits for one second before trying again. -
lockToLastPage
: An optional boolean parameter indicating whether to search only the last page in the_context.Pages
collection. Default value isfalse
.
null
-
PlaywrightException
: If the Playwright library is unable to find the element.
This method calls the FindElement()
method with the specified selector and lockToLastPage
parameter, and waits for the element to vanish. It retries the wait the specified number of times, waiting for one second between retries. If the element vanishes, it logs an information message with the selector, and returns null
. If the element does not vanish after the specified number of retries, it logs an information message with the selector, and returns the last IElementHandle
found by the FindElement()
method. If the element is not found, a PlaywrightException
is thrown.