【问题标题】:can we change time interval (500 miliseconds) of wait.until in WebDriver Sampler我们可以在 WebDriver Sampler 中更改 wait.until 的时间间隔(500 毫秒)吗
【发布时间】:2020-05-07 15:09:13
【问题描述】:

我的脚本在点击按钮后等待 toast 消息。

wait.until(ui.ExpectedConditions.visibilityOfElementLocated(pkg.By.xpath("//*[@id='btnSubmitt']")))

但我看到了下面的消息 预期条件失败:等待由

定位的元素的可见性
By.xpath: //*[@id='btnSubmitt'] 

(尝试 1 秒,500 毫秒间隔

问题:想将时间间隔从 500 毫秒更改为 50 毫秒。 所以脚本应该每隔 50 毫秒检查一次预期的元素。

问题:我的脚本在 Chrome 浏览器中的开发人员工具下获得比性能选项卡更多的响应时间。

【问题讨论】:

标签: selenium jmeter webdriver


【解决方案1】:

类似:

var wait = new org.openqa.selenium.support.ui.WebDriverWait(WDS.browser, 1000).pollingEvery(50, java.util.concurrent.TimeUnit.MILLISECONDS)

应该为您解决问题。

参考资料:

【讨论】:

    猜你喜欢
    • 2018-10-05
    • 1970-01-01
    • 1970-01-01
    • 2013-08-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多