[英]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.