在 Katalon Studio 的 WebUI 中检索所有 DOM 元素

Retrieve all DOM elements in WebUI in Katalon Studio

有没有办法在 Katalon Studio 中检索所有 DOM 元素,以便我可以对它们随机执行操作?

import org.openqa.selenium.WebDriver
import com.kms.katalon.core.webui.driver.DriverFactory
import org.openqa.selenium.By

WebUI.openBrowser('forum.katalon.com')
WebDriver driver = DriverFactory.getWebDriver()
elements = driver.findElements(By.xpath("//*"))

试试看是否有帮助。