Actions in Webdrivers: an example of a working set of data

别来无恙 提交于 2019-12-13 03:46:24

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!