Monday, August 29, 2016

Drag and drop is now common functionality across many web applications for interactive user interface and easy upload. To automate drag and drop in your automation test script, selenium provides a class called Actions for interactive actions.Scenario:1. Launch https://jqueryui.com/draggable/2. Drag and release the element an X=250 and Y= 10 Pixels.To automate the above scenario using Selenium Webdriver , we would need to use dragAndHold(WebElement element) function of selenium library.Code:

You can also use InputStream instead of File if you don't want to send File.To send the inputstream instead of file please replace the statement reqEntity.addBinaryBody("file", new File(filePath));with reqEntity.addBinaryBody("file", fileIPStream); in above code snippet.