问题
I am banging my head against the webdriver specs to get actions happening.
NOTE: I am after the payload to send to the webdriver. I am not after a bunch of lines of code to make up a set of actions. I am interested in the payload to send to the action endpoints.
I am reading the specs, but I am having problems understanding what exactly I have to pass, and how, to the web driver's endpoint to make anything happen. I am trying to get it to work with Firefox, as Chrome doesn't implement them at all for now.
Are you able to provide a couple of examples of actions to get me going? Something that works and to build upon?
回答1:
See if this code helps :
WebElement main_link= driver.findElement(By.linkText("Main_Link"));
Actions action = new Actions(driver);
action.moveToElement(main_link).build().perform();
driver.findElement(By.linkText("sub_link")).click();
来源:https://stackoverflow.com/questions/48398425/actions-in-webdrivers-an-example-of-a-working-set-of-data