I need to do this 1. http://the-internet.herokuapp.com/dynamic_loading/1 2. Use Explicit Wait for 30 seconds 3. Click on start button and verify Hello World!.
I have written the following code but element.getText is null.
driver.get("http://the-internet.herokuapp.com/dynamic_loading/1");
WebDriverWait wait=new WebDriverWait(driver, 30);
WebElement all=driver.findElement(By.xpath("//*[@id='start']/button"));
all.click();
WebElement element=wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//*[@id='finish']/h4")));
driver.findElement(By.xpath("//*[@id='finish']/h4"));
String text=element.getText();
System.out.println("hi:"+text);
//assertEquals("Hello World!", text);