等待在硒webdriver中不起作用 [英] Wait is not working in selenium webdriver

查看:79
本文介绍了等待在硒webdriver中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要有关Selenium Webdriver中等待功能的帮助.
我有以下代码等待"Progressing Pop up"消失. 似乎它只等待几秒钟并终止脚本.请让我知道另一种选择吗?

I need help on wait function in Selenium webdriver.
I have the following code to wait for "Progressing Pop up" to disappear. It seems it waits only for some seconds and terminates the script. Please let me know what are the other option?

public static void ProcessingData() throws Exception {
    WebDriverWait wait1 = new WebDriverWait( driver , 180 ); 


    wait1.until(ExpectedConditions.invisibilityOfElementLocated(By.xpath("//div[@class='dijitDialogPaneContent']/div/p/b[contains(text()='Processing ...']")));
}

推荐答案

我将仔细研究一下您提供的xpath选择器...

I'd take a closer look at your xpath selector... you are providing

...b[contains(text()='Processing ...']

如果您知道该文本等于处理内容,则应使用

If you know that the text is equal to processing, then you should use

...b[text()='Processing ...'].

如果您知道文本包含Processing ...,则应使用

If you know that the text CONTAINS Processing ... then you should use,

...b[contains(text(), 'Processing ...']

这篇关于等待在硒webdriver中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆