Drag and drop syntax in Selenium? - TestingQ.com

-->Exclusive Portal for Testing Jobs

Drag and drop syntax in Selenium?

Element which needs to drag.
WebElement source=driver.findElement(By.xpath("//*[@id='element1']"));

Element on which need to drop.
WebElement destination=driver.findElement(By.xpath("//*[@id='element2']")); 


Using Action class we can drag and drop.
Actions act=new Actions(driver);
act.dragAndDrop(source, destination).build().perform();




To receive daily posted JOBS and Interview Questions
Just enter your email address below and click 'Submit'

Enter your email address:



Make sure to activate your subscription by clicking on the activation link sent to your email

No comments:

Post a Comment