简体   繁体   中英

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.

Thank you

For Selenium 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.

I don't know how it works in java, but in js it works in such way

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

This link may help to write same code in java =)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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