简体   繁体   English

如何自动化Selenium RC中的拖放功能

[英]how to automate the drag and drop functionality in selenium rc

I am trying to automate a drag and drop functionality in selenium rc, i am not sure of there is a drag and drop method in the selenium api, any idea please on how such a test can be performed. 我正在尝试自动化selenium rc中的拖放功能,我不确定selenium api中是否存在拖放方法,请就如何执行这种测试提出任何想法。

Thank you 谢谢

For Selenium RC, 对于硒RC,

selenium.mouseMove("<sourceLocator>");
selenium.mouseDown("<sourceLocator>");
selenium.mouseMove("<destinationLocator>");
selenium.mouseUp("<destinationLocator>");

Here is the link to it. 这是链接 It will be better if you start using Selenium Webdriver instead of RC, since it is officially deprecated. 如果您开始使用Selenium Webdriver而不是RC会更好,因为它已正式弃用。

I don't know how it works in java, but in js it works in such way 我不知道它如何在Java中工作,但在JS中它以这种方式工作

driver.actions().dragAndDrop(source, target).perform();

This link may help to write same code in java =) 链接可能有助于在java =中编写相同的代码)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM