硒的webdriver:鼠标光标悬停不工作的火狐版本50硒的webdriver:鼠标光标悬停不工作
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 Ajax_Mouse_Interactions {
public static void main(String[] args) throws InterruptedException {
路径为Firefox司机
System.setProperty("webdriver.gecko.driver",
"C://Users//user2//Downloads//geckodriver-v0.11.1-win64//geckodriver.exe");
WebDriver driver = new FirefoxDriver();
driver.get("http://www.amazon.in/");
Thread.sleep(20000);
操作类用于鼠标处理
Actions action = new Actions(driver);
WebElement element=driver.findElement(By.linkText("nav-link-yourAccount"));
action.moveToElement(element).build().perform();
}
}
获得以下异常
Upsupported命令异常