Dragging multiple items to one location simultaneously

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Dragging multiple items to one location simultaneously

shelly garg
Hi Tarun,

I have a requirement where I have to drag multiple items to one location simultaneously.

I am using the following, but it is not working. Could u please help me here

List <WebElement> listFields = driver.findElements(By.className("className"));
               
                 Actions builder = new Actions(driver);
       
              builder.clickAndHold(listFields .get(2)).clickAndHold(listFields .get(3)).clickAndHold(listFields .get(4)).clickAndHold(listFields .get(5))
                      .moveToElement(dropLocation).release().build().perform();

       

Please note : My require is to select multiple items and drop altogether at one location. I cannot use the loop, because it will drag and drop one by one, which is not my requirement.
Reply | Threaded
Open this post in threaded view
|

Re: Dragging multiple items to one location simultaneously

softwaretestingforum
Administrator
Please post only selenium training session questions in this forum.
The forum to post WebDriver question is -

http://www.seleniumtests.com/p/selenium-2-forum.html
~ seleniumtests.com