How to utilise await inward webdriver till chemical share becomes invisible or hidden

As you lot know, WebDriver is software spider web application regression testing tool as well as you lot volition aspect upward many problems during your webdriver test instance creation as well as execution. You must knows alternate solution if 1 non plant for your software automation examine scenario. For example, you lot bring used IMPLICIT WAIT inward your software automation examine instance but if it is not sufficient to handgrip your status of waiting till chemical cistron becomes invisible from page as well as then you lot tin forcefulness out role it's choice means of using EXPLICIT WAIT inward your examine case.

In my PREVIOUS POST, I bring depict role of visibilityOfElementLocated(By locator) method amongst explicit hold off to hold off till chemical cistron becomes visible (not hidden) on software spider web application page. Now allow nosotros await at reverse side. If you lot wants webdriver to hold off till element becomes invisible or hidden from page as well as then nosotros tin forcefulness out use invisibilityOfElementLocated(By locator) method amongst hold off condition.

Syntax for hold off till chemical cistron invisible from page is equally bellow.
WebDriverWait hold off = novel WebDriverWait(driver, 15); wait.until(ExpectedConditions.invisibilityOfElementLocated(By.xpath("//input[@id='text4']")));

In inward a higher house syntax, you lot tin forcefulness out alter webdriver hold off fourth dimension from xv to 20, xxx or to a greater extent than equally per your requirement. Also you lot tin forcefulness out role whatever OTHER ELEMENT LOCATING METHODS except By.xpath. Practical instance of webdriver hold off till element becomes invisible is equally bellow.

Copy bellow given @Test method business office of hold off till chemical cistron invisible and supersede it amongst the @Test method business office of instance given on THIS PAGE.(Note : @Test method is marked with pink color in that linked page).

@Test  populace void examine () throws InterruptedException, IOException   {    //Wait for chemical cistron invisible   WebDriverWait hold off = novel WebDriverWait(driver, 15);   wait.until(ExpectedConditions.invisibilityOfElementLocated(By.xpath("//input[@id='text4']")));    System.out.print("Text box text4 is straight off invisible");        }

You tin forcefulness out VIEW EXAMPLE OF "waitForElementNotPresent" IN SELENIUM IDE if you lot are using selenium IDE.
More interesting articles here :Generation Enggelmundus Internet Marketing Tool here :Zeageat IM http://www.software-testing-tutorials-automation.com/
Post a Comment (0)
Previous Post Next Post