簡體   English   中英

使用Selenium Webdriver的鼠標懸停不適用於Firefox瀏覽器

[英]Mouse hover not working for Firefox browser using Selenium webdriver

以下是我用於自動化腳本的firefox,gecko驅動程序和selenium版本:Firefox瀏覽器:52.0 selenium:3.0.1 gecko驅動程序:0.11.1

以下是我的鼠標懸停操作代碼:

Actions action = new Actions(driver.getWebDriver());
WebElement mainMenu = driver.findElement(By.xpath("(//*[@class='ciebar__menu-item ciebar__menu-item--has-dropdown medium-4 '])[1]/a"));
WebElement submenuxpath = driver.findElement(By.xpath("(//*[@class='ciebar__menu-item ciebar__menu-item--has-dropdown medium-4 '])[1]/ul/li[1]/a"));
action.moveToElement(mainMenu).moveToElement(submenuxpath).click().build().perform();

此代碼對於chrome和IE瀏覽器正常運行,並且僅在Firefox中面臨問題。 我已經嘗試通過升級Selenium和Gecko驅動程序,但是那個時候瀏覽器沒有調用。 下面是正在顯示的錯誤信息

POST / session / dee48bec-9a8a-4ae7-92a3-f8fcbd218f5a / moveto與已知命令不匹配Build info:版本:'2.42.2',版本:'6a6995d31c7c56c340d6f45a76976d43506cd6cc',時間:'2014-06-03 10:52: 47'系統信息:主機:'PC189896',ip:'10 .243.169.86',os.name:'Windows 7',os.arch:'amd64',os.version:'6.1',java.version:'1.8 .0_141'驅動程序信息:org.openqa.selenium.firefox.FirefoxDriver功能[{moz:profile = C:\\ Users \\ 313772 \\ AppData \\ Local \\ Temp \\ rust_mozprofile.2bNvQAYH4V01,rotatable = false,超時= {implicit = 0,頁面加載= 300000,腳本= 30000},頁面加載策略=正常,平台=任何,specificationLevel = 0,moz:accessibilityChecks =否,acceptInsecureCerts = true,瀏覽器版本= 52.0.1,平台版本= 6.1,moz:進程ID = 11216,瀏覽器名稱= firefox,platformName = windows_nt}]會話ID:dee48bec-9a8a-4ae7-92a3-f8fcbd218f5a

請幫忙。

看起來/{session id}/moveto eckedriver不支持/{session id}/moveto端點。 有一個關於這個的討論在這里和bug報告已經提出了對硒這里

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM