本文介紹了如何自動化拖拽&使用 Selenium WebDriver Java 刪除功能的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
限時送ChatGPT賬號..
如何自動化拖拽&在 java 中使用 Selenium WebDriver
刪除功能?
How to automate drag & drop functionality using Selenium WebDriver
in java?
推薦答案
有一個頁面記錄了高級用戶交互;其中有很多關于如何生成一系列動作的很好的例子,你可以找到在這里
There is a page documenting Advanced User Interactions; which has a lot of great examples on how to generate a sequence of actions, you can find it here
// Configure the action
Actions builder = new Actions(driver);
builder.keyDown(Keys.CONTROL)
.click(someElement)
.click(someOtherElement)
.keyUp(Keys.CONTROL);
// Then get the action:
Action selectMultiple = builder.build();
// And execute it:
selectMultiple.perform();
或
Actions builder = new Actions(driver);
Action dragAndDrop = builder.clickAndHold(someElement)
.moveToElement(otherElement)
.release(otherElement)
.build();
dragAndDrop.perform();
這篇關于如何自動化拖拽&使用 Selenium WebDriver Java 刪除功能的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!