硒的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命令異常