在 Chrome 中,当我单击按钮时,出现“未知错误:
cannot read property 'scrollleft' of null
他们是该页面中的 1 个输入字段,我可以输入值,因为只有按钮单击不起作用。
此点击在 Firefox 中运行良好。仅在 Chrome 中出现问题
IWebElement element = wait.Until(d => d.FindElement(locator));
wait.Until(ExpectedConditions.ElementToBeClickable(element));
element.Click();
笔记:
此页面没有框架,没有卷轴。
你需要调用Click()
一旦元素通过返回WebDriver等待如下:
IWebElement element = wait.Until(d => d.FindElement(locator));
new WebDriverWait(driver, TimeSpan.FromSeconds(10)).Until(ExpectedConditions.ElementToBeClickable(element)).Click();
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)