Home > Automation Testing > Use Action class to perform drag and drop In selenium

Use Action class to perform drag and drop In selenium

Drag and drop activity performed by using Actions class.

  1. dragAndDrop(WebElement source, WebElement target) → It used to drag source element to target web element.
  2. dragAndDropBy(WebElement source, offsetX , offsetY) →  It used to drag source web element to targeted location using offset.

Code snippet:

 

This Article is TAGGED in , , . BOOKMARK THE permalink.

Avatar photo
Neeraj Vishwakarma
Senior QA Engineer Skills: Automation Testing, Manual Testing, STLC, Java, Selenium Webdriver, Protractor, Database Testing.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">