Element is not clickable at point error in chrome
2016-01-07 15:51
447 查看
I see this only in Chrome.
The full error message reads:
"org.openqa.selenium.WebDriverException: Element is not clickable at point (411, 675). Other element would receive the click: ..."
The element that 'would receive the click' is to the side of the element in question, not on top of it and not overlapping it, not moving around the page.
I have tried adding an offset, but that does not work either. The item is on the displayed window without any need for scrolling.
----------------------------------
This is caused by following 2 types:
1.The element is not visible to click.
Use Actions or JavascriptExecutor for making it to click.
By Actions:
By JavascriptExecutor:
or
Then click on the element.
2.The page is getting refreshed before it is clicking the element.
For this, make the page to wait for few seconds.
--------------------
1.The element is not visible at the view point(not seen in the screen)
Try this
2.Element is not present at the time of execution. Use WebDriverWait to until the element is present.
In my python script, I try the second method, details as below
[/code]
Attation: In chrome we should use "document.body.scrollTop", "document.documentElement.scrollTop" doesn't work in chrome
if you want to get the value of scrollTop, may you can try this "var sTop=document.body.scrollTop+document.documentElement.scrollTop;"
The full error message reads:
"org.openqa.selenium.WebDriverException: Element is not clickable at point (411, 675). Other element would receive the click: ..."
The element that 'would receive the click' is to the side of the element in question, not on top of it and not overlapping it, not moving around the page.
I have tried adding an offset, but that does not work either. The item is on the displayed window without any need for scrolling.
----------------------------------
This is caused by following 2 types:
1.The element is not visible to click.
Use Actions or JavascriptExecutor for making it to click.
By Actions:
WebElement element = driver.findElement(By("element_path")); Actions actions = new Actions(driver); actions.moveToElement(element).click().perform():
By JavascriptExecutor:
JavascriptExecutor jse = (JavascriptExecutor)driver; jse.executeScript("scroll(250, 0)"); // if the element is on top. jse.executeScript("scroll(0, 250)"); // if the element is on bottom.
or
JavascriptExecutor jse = (JavascriptExecutor)driver; jse.executeScript("arguments[0].scrollIntoView()", Webelement);
Then click on the element.
2.The page is getting refreshed before it is clicking the element.
For this, make the page to wait for few seconds.
--------------------
1.The element is not visible at the view point(not seen in the screen)
Try this
JavascriptExecutor jse = (JavascriptExecutor)driver; jse.executeScript("scroll(250, 0)"); // this will scroll up or jse.executeScript("scroll(0, 250)"); // this will scroll down
2.Element is not present at the time of execution. Use WebDriverWait to until the element is present.
WebDriverWait wait = new WebDriverWait(driver, 15); wait.until(ExpectedConditions.elementToBeClickable(By.id("ID of the element")));---------------------------
In my python script, I try the second method, details as below
[/code]
js_="var q=document.body.scrollTop=10000" driver.execute_script(js_)
Attation: In chrome we should use "document.body.scrollTop", "document.documentElement.scrollTop" doesn't work in chrome
if you want to get the value of scrollTop, may you can try this "var sTop=document.body.scrollTop+document.documentElement.scrollTop;"
相关文章推荐
- eclipse配置
- Web前端性能优化
- .net Windows Service安装包制作
- 折角效果
- Win10无法安装可选功能提示错误代码0x800F081F的解决方法
- 向Tornado后台传数据
- 二值图像连通体标记
- JS日期操作
- rails权限管理—devise+cancan+rolify
- html5新特性
- JVM调优总结
- getaddrinfo
- regex: add quote for words in Notepad++
- Python Json获取天气预报
- 引用和指针的区别
- 使用Appium测试native程序
- springmvc中@responseBody返回Json格式中文乱码问题
- FMDB官方使用文档-GCD的使用-提高性能(翻译)
- Android 串口读取设备相关知识。。总结比较乱,部分转载(未完)
- 简析Android内存泄漏