1、跑webdriver用例时遇到org.openqa.selenium.ElementNotVisibleException: Element is not currently visible and so may not be interacted with
4、解决:最先想到的就是这个元素可能光使用id定位不到,所以尝试用xpath定位,果然成功了,代码如下:
Command duration or timeout: 11 milliseconds,如下图:
2、定位这个元素时,遇到该异常:
3、刚开始用的id定位,就报这个异常,代码如下:
driver.findElement(By.id("billYear-plus")).click();
4、解决:最先想到的就是这个元素可能光使用id定位不到,所以尝试用xpath定位,果然成功了,代码如下:
driver.findElement(By.xpath("//div[@id='pop-up']//span[@id='billYear-plus']")).click();