简体   繁体   English

Selenium webdriver C# 自动化脚本在边缘浏览器中不起作用

[英]Selenium webdriver C# automation script not working in edge browser

I have a selenium web driver C# script running successfully in IE browser.我有一个在 IE 浏览器中成功运行的 selenium web 驱动程序 C# 脚本。 But the same script is not working when I use the MS edge driver.但是当我使用 MS 边缘驱动程序时,相同的脚本不起作用。 I have ensured that the OS build number is same as the edge build as suggested here .我已确保操作系统内部版本号与此处建议的边缘版本号相同。 The script launches the URL but fails to find the element with the XPath provided.I am using the latest selenium version: 3.9.1.0 and Edge version:38.14393.2068.0 Please help.该脚本启动了 URL,但无法找到提供 XPath 的元素。我使用的是最新的 selenium 版本:3.9.1.0 和 Edge 版本:38.14393.2068.0 请帮忙。 Thanks.谢谢。

I have found that testing with Edge is a real pain because Selenium runs so fast.我发现使用 Edge 进行测试真的很痛苦,因为 Selenium 运行得非常快。 If the Element isn't found immeditaely then it fails (as it should because it doesn't see it).如果 Element 没有立即找到,那么它就会失败(因为它没有看到它,所以它应该失败)。 The only fix I have found is to add a Sleep time before commands that take longer.我发现的唯一解决方法是在需要更长时间的命令之前添加睡眠时间。 For example, if the webdriver is directed to a new url, it needs more time to load and find the element.例如,如果 webdriver 被定向到一个新的 url,它需要更多的时间来加载和查找元素。 This is a lot of trial and error, and some days it runs slower than others, but this may be what you need to do.这是大量的反复试验,有时它的运行速度比其他天慢,但这可能是您需要做的。

暂无
暂无

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

相关问题 c# - Selenium WebDriver 4 不适用于 Edge(铬) - c# - Selenium WebDriver 4 not working with Edge (chromium) 如果浏览器已打开 (Edge Chromium/VB.NET/C#),Selenium 自动化会失败 - Selenium Automation fails if Browser Already Open (Edge Chromium/VB.NET/C#) 用selenium C#webdriver完全关闭浏览器 - Close browser completely with selenium C# webdriver 如何在Windows 10中更改IE Edge浏览器的安全区域设置以实现硒WebDriver自动化 - How to change Security zone setting of IE Edge browser in windows 10 for selenium webdriver automation C# Selenium Edge - 获取 Edge 浏览器的运行实例 - C# Selenium Edge - get running instance of Edge browser c# Selenium EdgeOptions 不适用于 Chromium Edge - c# Selenium EdgeOptions not working for Chromium Edge 使用分页(Selenium webdriver C#) - Working with Pagination (Selenium webdriver C#) 如何使用 C# 在 Selenium WebDriver (Selenium 2) 中最大化浏览器窗口? - How to maximize the browser window in Selenium WebDriver (Selenium 2) using C#? driver.Manage()。Cookies.DeleteAllCookies(); 不适用于Edge Browser Windows 10硒c# - driver.Manage().Cookies.DeleteAllCookies(); not working for Edge Browser Windows 10 selenium c# C# 自动化边缘浏览器 - 使用边缘驱动程序 - 自动测试程序 - 失败:未找到匹配功能 (SessionNotCreated) - C# Automation Edge Browser - using Edge Driver - auto testing program - Failure: No matching capabilities found (SessionNotCreated)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM