element is not clickable at point Selenium Webdriver Solved!
element is not clickable at point(x,y)
Seriously?? And then you try everything :
- This happens only on chrome so it works on ie and firefox
- ChromeDriver always clicks the middle of the element
- The reason Chrome driver doesn't calculate the correct screen location of link.
// Find an element and define it WebElement elementToClick = driver.findElement(By.xpath("some xpath")); // Scroll the browser to the element's Y position ((JavascriptExecutor) driver).executeScript("window.scrollTo(0,"+elementToClick.getLocation().y+")"); // Click the element elementToClick.click();
Note: If the Y position doesnt work the X will work for sure
((JavascriptExecutor) driver).executeScript("window.scrollTo(0,"+elementToClick.getLocation().x+")");
Update
If the solution doesn't work or even if it does Download the latest chrome driver and bingo!! You will see it work for sure
A workaround I came up with:
ReplyDeleteprotected void ClickElement(IWebElement element)
{
var builder = new Actions(driver);
builder
.MoveToElement(element)
.Click(element)
.Build()
.Perform();
}
I used it this one but getting the same issue.And not for chrome its getting for firefox.
DeleteI used it this one but getting the same issue.And not for chrome its getting for firefox.
DeleteAwesome Post!! Found it after 2 days of googling. Was an absolute life saver for me.
ReplyDelete@ Mohit Glad this helped!
DeleteI am beginner to selenium what is this exception? org.openqa.selenium.WebDriverException: Element is not clickable.
ReplyDeletesupreme outlet
ReplyDeleteoff white x jordan 1
yeezy shoes
ralph lauren uk
supreme hoodie
jordan shoes
michael kors outlet online
nike air max
kd 11
balenciaga shoes
cheap jordans
ReplyDeletekobe
bape clothing
jordan shoes
yeezy boost
kd shoes
golden goose
longchamp
lebron 15
supreme clothing