selenium - Unable to perform dragAndDrop function in webdriver -


drag , drop not working, please buddy me.

driver.get("http://www.w3schools.com/html/tryit.asp?filename=tryhtml5_draganddrop");      actions builder = new actions(driver);     driver.manage().timeouts().implicitlywait(10, timeunit.seconds);     driver.switchto().frame(driver.findelement(by.classname("result_output")));     system.out.println(driver.findelement(by.tagname("body")).gettext());     action dropimage = builder.draganddrop(driver.findelement(by.id("drag1")), driver.findelement(by.id("div1"))).build();     dropimage.perform(); 

you seem not using webdriver returned driver.switchto().frame().

try this:

driver.get("http://www.w3schools.com/html/tryit.asp?filename=tryhtml5_draganddrop");  driver.manage().timeouts().implicitlywait(10, timeunit.seconds); webdriver framedriver = driver.switchto().frame(driver.findelement(by.classname("result_output")));  actions builder = new actions(framedriver); action dropimage = builder.draganddrop(framedriver.findelement(by.id("drag1")), framedriver.findelement(by.id("div1"))).build(); dropimage.perform(); 

ps: might not issue: "not working" not quite descriptive enough. happens? see? stacktrace? error message? output? iframe content?


Comments