Quality is delighting customers
Please explain with scenario?
Tags:
This is the most common question that is asked by any quality assurance company when hiring automation engineers.
We can use webdriverwait when we want to wait until a particular condition is met or the specified time is elapsed. This wait works for a particular instance only & also can throw exceptions when element not found.
Syntax:
//WebDriverWait wait = new WebDriverWait(WebDriverRefrence,TimeOut);
For e.g:
WebDriverWait wait = new WebDriverWait (driver, 20);
wait.until(ExpectedConditions.VisibilityofElementLocated(By.xpath(""//button[@value='Submit']"")));
However, You can provide more details about this wait like expected condition etc.
WebDriverWait uses the below mentioned expected conditions:
alertIsPresent()
elementSelectionStateToBe()
elementToBeClickable()
elementToBeSelected()
frameToBeAvaliableAndSwitchToIt()
invisibilityOfTheElementLocated()
invisibilityOfElementWithText()
presenceOfAllElementsLocatedBy()
presenceOfElementLocated()
textToBePresentInElement()
textToBePresentInElementLocated()
textToBePresentInElementValue()
titleIs()
titleContains()
visibilityOf()
visibilityOfAllElements()
visibilityOfAllElementsLocatedBy()
visibilityOfElementLocated()
I hope this resolves your query.
Thanks
Anand Singh
© 2021 Created by Quality Testing.
Powered by