Selenium Web 驱动程序元素单击在 Windows 10 中不起作用 [英] selenium web driver element click not working in windows 10

查看:38
本文介绍了Selenium Web 驱动程序元素单击在 Windows 10 中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 selenium webdriver 在 C# 中创建自动化工具.该自动化在 Windows 7 上运行良好,但在 Windows 10 上运行不正常.

I am using selenium webdriver for automation tool creation in C#. That automation working fine windows 7, but not working windows 10.

例如

driver.FindElement(By.XPath("//button[@type='submit']")).Click();

点击无效.

错误消息.

threw an exception of type 'OpenQA.Selenium.WebDriverException'
    base: {"The HTTP request to the remote WebDriver server for URL http://localhost:7057/hub/session/c335c107-a5ba-48a1-8858-58de998c62dc/element/%7B0678bf84-d09c-43d4-a4cf-ea35f73168a8%7D/click timed out after 60 seconds."}.

推荐答案

试试这个:

代替 .Click();* 使用 .SendKeys(Keys.Return);

driver.FindElement(By.XPath("//button[@type='submit']")).SendKeys(Keys.Return);

这篇关于Selenium Web 驱动程序元素单击在 Windows 10 中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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