Selenium WebDriver : How to facial expression till chemical cistron visible or look or acquaint on page

In whatever software spider web application's webdriver test case, yous tin easily human face for presence of chemical ingredient using IMPLICIT WAIT. If yous convey used implicit wait inwards your testify instance too thus yous produce non involve to write whatever extra conditional arguing to human face for element visibility. But inwards about cases, if whatever chemical ingredient is taking equally good much time to endure visible on software spider web page too thus yous tin role EXPLICIT WAIT status inwards your testify case.

If yous convey a scenario to human face till chemical ingredient visible on software web page too thus selenium webdriver/Selenium two has its ain method named visibilityOfElementLocated(By locator) to cheque the visibility of chemical ingredient on software web page. We tin role this method amongst explicit webdriver human face status to human face till chemical ingredient visible of acquaint on page. However, nosotros tin human face for chemical ingredient to endure clickable using elementToBeClickable(By locator) method equally described inwards THIS ARTICLE.

Syntax to human face till chemical ingredient visible on page is equally bellow. It volition human face max fifteen seconds for element. As before long equally chemical ingredient visible on page, webdriver volition become for executing adjacent statement.
WebDriverWait human face = novel WebDriverWait(driver, 15); wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//input[@id='text3']")));

Here is practical instance of human face for chemical ingredient visible. Execute it in ane trial too and thus role it for your software spider web application testify scenario.

Copy bellow given @Test method business office of human face for visibility of element located example too supplant 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  world void testify () throws InterruptedException, IOException   {      //To human face for chemical ingredient visible   WebDriverWait human face = novel WebDriverWait(driver, 15);   wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//input[@id='text3']")));      driver.findElement(By.xpath("//input[@id='text3']")).sendKeys("Text box is visible now");   System.out.print("Text box text3 is immediately visible");       }

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