【发布时间】:2019-08-17 21:03:36
【问题描述】:
我想实现以下目标: WebElement ele = (WebElement) ((JavascriptExecutor) 驱动程序) .executeScript("返回参数[0].shadowRoot",element); 使用空手道的驱动程序对象。 请让我知道如何使用空手道的驱动程序对象来实现(.executeScript())
【问题讨论】:
标签: karate
我想实现以下目标: WebElement ele = (WebElement) ((JavascriptExecutor) 驱动程序) .executeScript("返回参数[0].shadowRoot",element); 使用空手道的驱动程序对象。 请让我知道如何使用空手道的驱动程序对象来实现(.executeScript())
【问题讨论】:
标签: karate
您可以使用driver.eval()在浏览器中执行任何JS:
* assert driver.eval('1 + 2') == 3
* match driver.eval('location.href') == webUrlBase + '/page-01'
【讨论】: