我正在使用 Selenium webdriver,但出现以下异常
org.openqa.selenium.ElementClickInterceptedException: Element <div id="nav-icon3"> is not clickable at point (21,37) because another element <div class="loader-section section-left"> obscures it
Build info: version: '3.141.59', revision: 'e82be7d358', time: '
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Session ID: 868f9daa-dd6c-4b53-846d-7323e7b0408e
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
我的代码如下。
driver.manage().timeouts().implicitlyWait(15, TimeUnit.SECONDS);
WebElement element = driver.findElement(By.id("nav-icon3"));
JavascriptExecutor executor = (JavascriptExecutor)driver;
executor.executeScript("arguments[0].click()", element);
driver.findElement(By.id("nav-icon3")).click();
driver.findElement(By.xpath("//ul[@id='slide-out']/li/ul/li[2]/a")).click();
driver.findElement(By.xpath("//ul[@id='slide-out']/li/ul/li[2]/div/ul/li/a")).click();
driver.findElement(By.id("newTravelerLink")).click();