http://www.franchising.com/ ---> 鼠标悬停(Franchises AZ)---> 需要点击Q
我试过以下
WebElement we1=driver.findElement(By.cssSelector("a[href='/franchises/']"));
WebElement we2=driver.findElement(By.cssSelector("a[href='/franchises/q.html']"));
String js = "arguments[0].style.height='auto'; arguments[0].style.visibility='visible';";
((JavascriptExecutor) driver).executeScript(js, we2); // I have used the script since the we2 is not visible
Actions builder=new Actions(driver);
builder.moveToElement(we1).perform();
Thread.sleep(5000);
we2.click();
任何人都可以尝试与我分享代码...我仍然收到“ElementNotVisibleException”