2
我在使用webdriver代碼的IE中遇到了鼠標懸停的問題,它在Chrome和Firefox中工作正常,但鼠標懸停問題只發生在IE中。我該如何解決這個問題?首先焦點的元素上,並在旁邊,我會點擊鏈接,請參見下面的代碼,selenium webdriver中的IE問題?
WebElement newbutton = driver.findElement(By.xpath("//html/body/div/span/form[2]/div/div/div[3]/div[2]/ul/span/li"));
Actions action = new Actions(driver);
action.moveToElement(newbutton).build().perform();
WebElement nextButton=driver.findElement(By.xpath(".//*[@id='menuFmId:headerForm:j_id130']/li/span"));
Actions action1 = new Actions(driver);
action1.moveToElement(nextButton).click(nextButton).build().perform();
請發佈您的HTML代碼,以便人們能夠更好地理解問題出在哪裏,因爲您在第一個按鈕中使用絕對xpath可能在IE中沒有檢測到它,必須查看代碼。 –