简体   繁体   English

chromeDriver窗口在wait.until()C#硒期间崩溃

[英]chromeDriver window crushes during wait.until() C# selenium

I'm having a bit difficulties with chrome driver and selenium, i have selenium.support version 3.141.0 and chrome driver version 2.43.0. 我在使用chrome驱动程序和selenium时遇到了一些困难,我拥有selenium.support版本3.141.0和chrome驱动程序版本2.43.0。

during a test run i click on a button which redirect me to a new page, so i use WebDriverWait.until() until a condition that check if a certain element exist is met but for reason the window is flashing for a few seconds and later just close. 在测试运行期间,我单击了将我重定向到新页面的按钮,因此我使用WebDriverWait.until()直到检查是否存在某个元素的条件得到满足,但由于该原因,窗口会闪烁几秒钟,然后就近

_wait.Until(d => d.FindElements(By.XPath("//div[@id = 'expression']")).Any());

edit: i found that the window is flashing and later shut down after this line which come after the wait.Until. 编辑:我发现该窗口正在闪烁,并且稍后在wait.Until之后的这一行之后关闭。

_driver.FindElements(By.ClassName("connections-list")).First();

the line return Sequence contains no elements although the element is visible and it still doesnt explain why the window shut down 行返回序列不包含任何元素,尽管该元素是可见的,并且仍然无法解释为什么窗口关闭了

Suggest you to use External supported library, And check your scenario with same: 建议您使用外部支持的库,并使用相同的方法检查方案:

Library : SeleniumExtras.WaitHelpers 图书馆: SeleniumExtras.WaitHelpers

You can use it as: 您可以将其用作:

wait.Until(SeleniumExtras.WaitHelpers.ExpectedConditions.ElementIsVisible(WebElement));

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何将Wait.Until与Selenium C#一起用于现有元素 - How to use Wait.Until with Selenium C# for existing element C# Selenium:使用等待时无法捕获异常。直到 - C# Selenium: Can't catch exception when using wait.Until Selenium C#wait.until(expectedconditions)…函数无法在屏幕上找到对象/元素 - Selenium c# wait.until(expectedconditions)… function fails to find objects/elements on screen 异常:等待时“ xx秒后超时”。直到Selenium WebDriver C# - Exception: “Timed Out After xx seconds” on wait.until Selenium WebDriver C# 如何在硒中使用硒wait.until与锚元素 - how to use selenium wait.until with anchor element in java Selenium - FireFox / Marionette驱动程序没有做等待。直到 - Selenium - FireFox/Marionette driver not doing wait.Until Selenium 3.8.0 wait.until调用引发异常 - Selenium 3.8.0 wait.until call throws exception C#Selenium Webdriver Chrome驱动程序等待模态窗口完全消失 - C# selenium webdriver chrome driver wait until modal window is completely gone 如果我已经有了FindsBy的元素,如何与硒一起使用Wait.Until - How to use Wait.Until with Selenium if I already have the element with FindsBy 硒`wait.until`不等到提供的路径在DOM上呈现 - selenium `wait.until` not waiting till provided path gets render on DOM
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM