Not able to drag and drop element to another element using Selenium-Webdriver -
i writing demo tests following drag , drop functionality.[refer attached screenshot] have written following code:
@test public void draganddroptest() { commonsteps(); webelement drag = driver.findelement(by.xpath("html/body/div[1]/div[3]/div[2]/div[1]/div[4]/div[3]/div[1]/div[1]/div/div[1]")); webelement drop = driver.findelement(by.xpath("html/body/div[1]/div[3]/div[2]/div[1]/div[4]/div[3]/div[1]/div[2]/div/div[1]")); actions builder = new actions(driver); action draganddrop = builder.clickandhold(drag).movetoelement(drop).release(drop).build(); draganddrop.perform(); }
webelement drag "right now" & webelement drop "quick press".
my code able find these elements, not drag , drop "right now" frame "quick press" frame.
also tried click on drag, click not working on it. think these collapsible drag , drop panels of jquery. how handle collapsible drag , drops using webdriver.
what changes should make in code achieve this?
actions builder = new actions(driver); builder.clickandhold(drag).movetoelement(drop).build(); builder.draganddrop(drag, drop).perform();
this worked me.
Comments
Post a Comment