0

我正在尝试在 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 的动作类中是否存在问题。

我得到的错误是线程“main”中的异常 org.openqa.selenium.UnsupportedCommandException: POST /session/9988ddc4-ea82-41c2-86d8-3a3815609d0e/moveto did not match a known command Build info: version: 'unknown' ,修订:'1969d75',时间:'2016-10-18 09:43:45 -0700'

4

1 回答 1

1

是的,它不起作用,因为在 geckodriver/marionette 中尚未实现 Actions API。

https://github.com/mozilla/geckodriver/issues/233

于 2017-01-12T21:52:55.590 回答