0
我嘗試將內容拖放到selenium中的搜索文本框中,但它執行拖動操作,但不會將它拖放到search-textbox.so我的問題是如何放入文本框。在硒中拖放java
driver.get("http://stackoverflow.com/questions/42159265/drag-and-drop-content-into-textbox-by-using-selenium");
WebElement from = driver.findElement(By.xpath("//*[@id='qinfo']/tbody/tr[1]/td[2]/p/b"));
Actions builder = new Actions(driver);
builder.doubleClick(from).perform();
Thread.sleep(1000);
WebElement to = driver.findElement(By.name("q"));
Action dragAndDrop = builder.clickAndHold(from).moveToElement(to).release(to).build();
dragAndDrop.perform();
應該給予更多的情況下你的答案。 – pik4