“unknown error: cannot read property 'scrollleft' of null” in Chrome using selenium

限于喜欢 提交于 2019-12-29 09:55:46

问题


In Chrome when I am clicking button, I am getting "unknown error:

cannot read property 'scrollleft' of null

Their is 1 Input field in that page I am able to enter value in that only Button click is not working. This Click is working fine in Firefox. issue only in Chrome

IWebElement element = wait.Until(d => d.FindElement(locator));
wait.Until(ExpectedConditions.ElementToBeClickable(element));
element.Click();

Note: There is no frames in this page, no scrolls.


回答1:


You need to invoke Click() once the element is returned through WebDriverWait as follows:

IWebElement element = wait.Until(d => d.FindElement(locator));
new WebDriverWait(driver, TimeSpan.FromSeconds(10)).Until(ExpectedConditions.ElementToBeClickable(element)).Click();


来源:https://stackoverflow.com/questions/54043630/unknown-error-cannot-read-property-scrollleft-of-null-in-chrome-using-selen

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!