我正在尝试单击selenium3的actions类中使用moveToElement的链接。但是它不起作用..我已经尝试了actions类中的其他方法(doubleclick,draganddrop),但似乎都不起作用。
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();
}
}selenium: 3.1 ff:50.1
selenium 3中的actions类有问题吗?
我收到的错误是线程"main“中的异常org.openqa.selenium.UnsupportedCommandException: POST /session/9988ddc4-ea82-41c2-86d8-3a3815609d0e/moveto与已知命令Build info不匹配:版本:‘未知’,版本:'1969d75',时间:'2016-10-18 09:43:45 -0700‘
发布于 2017-01-13 05:52:56
是的,它不能工作,因为动作API还没有在geckodriver/marionette中实现。
https://stackoverflow.com/questions/41622397
复制相似问题