【发布时间】:2017-05-28 02:30:33
【问题描述】:
我正在尝试在 selenium3 的操作类中单击使用 moveToElement 的链接。但它不起作用。 我尝试了动作类中的其他方法(双击、拖放),但似乎都没有工作..
package Advanced.Actions;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.interactions.Actions;
public class z_clickEvent {
public static void main(String[] args) {
// TODO Auto-generated method stub
String url = "https://www.myhcl.com/Login/home.aspx";
System.setProperty("webdriver.gecko.driver", "C:\\code\\lib\\browser drivers\\geckodriver.exe");
WebDriver driver = new FirefoxDriver();
driver.manage().window().maximize();
driver.get(url);
WebElement loginHelp = driver.findElement(By.linkText("Login Help"));
Actions action = new Actions(driver);
action.moveToElement(loginHelp).build().perform();
action.click().build().perform();
}
}
硒:3.1 ff:50.1
selenium 3 中的操作类是否存在问题。
我得到的错误是 线程“主”org.openqa.selenium.UnsupportedCommandException 中的异常:POST /session/9988ddc4-ea82-41c2-86d8-3a3815609d0e/moveto 与已知命令不匹配 构建信息:版本:'未知',修订:'1969d75',时间:'2016-10-18 09:43:45 -0700'
【问题讨论】:
标签: selenium selenium-webdriver selenium3