if(!driver.findElement(By.id("pt1:r1:0:r1:2:r1:0:it1::content")).isEnabled())
{
System.out.println("IS NOT DISPLAYED"); // if text box is display
driver.findElement(By.id("pt1:r1:0:r1:2:next")).click();
}
else if(driver.findElement(By.id("pt1:r1:0:r1:2:r1:0:it1::content")).isEnabled())
{
System.out.println("IS DISPLAYED"); // if text box is not display
driver.findElement(By.id("pt1:r1:0:r1:2:r1:0:it1::content")).sendkey("ABCXYZ");
driver.findElement(By.id("pt1:r1:0:r1:2:next")).click();
}
我尝试过try和catch阻止其工作,但执行脚本需要时间。