I am getting WebdriverException on click of checkbox. I used code which worked fine earlier in Chrome but it is not working now.
There is an overlay of div element which remains visible like header and the other page scrolls up and down according to the dynamic checkbox.
It is able to highlight the checkbox button in that table row, but only partial row with checkbox is visible when script runs due to page scroll. When I am doing it manually, whole table containing 4-5 rows is visible
. The element which I am trying to click is dynamic.
I tried with Explicit wait, Javascript click and Action click.
error shows:
org.openqa.selenium.WebdriverException: unknown error: Element ... is not clickable at point (146,190). Other element would receive the click: <div id= "commonheader-wrapper" ng-reflect-ng-class="[object Object] class="panel_body"> ...
this id = "commonheader-wrapper" is of overlay (header) in the page which remains the same and part of the page where table lies scrolls up and down when I am trying to click on checkbox of that particular row.
WebElement checkbox = driver.findElement(By.xpath("//table/tbody/tr[1]/td[1]"));
Actions builder = new Actions(driver);
builder.moveToElement(checkbox).click().build().perform();
Tried with
WebdriverWait wait = new WebdriverWait(driver, 140);
wait.until(ExpectedConditions.elementToBeClickable(checkbox);
checkbox.click();
And
int elementPosition = element.getLocation().getY();
String js = String.format("window.scroll(0, %s)", elementPosition);
((JavascriptExecutor)driver).executeScript(js);
checkbox.click()
relevant HTML is given below