-2

I got this error message while trying to click on a specific collapsible button.

element click intercepted: Element Filters is not clickable at point (522, 265). Other element would receive the click:

...

This button has this:

<button class="action-default _active" data-action="grid-filter-expand" data-bind="css: {_active: hasVisible() &amp;&amp; $collapsible.opened()}, disable: !hasVisible(), toggleCollapsible, i18n: 'Filters'">Filters</button>

It's XPATH:

//*[@id="container"]/div/div[2]/div[1]/div[3]/div/button

I did this:

WebDriverWait wait6 = new WebDriverWait(driver,Duration.ofSeconds(10)); 
WebElement elementProd44 = wait6.until(ExpectedConditions.elementToBeClickable(By.xpath("//*[@id=\"container\"]/div/div[2]/div[1]/div[3]/div/button")));
elementProd44.click();

What am i doing wrong?

Note: i cannot share the URL because it is hidden.

1
  • Can you at least post that specific page's full HTML source? Commented Dec 7, 2022 at 5:24

1 Answer 1

0

Try with following xpath options

WebDriverWait wait6 = new WebDriverWait(driver,Duration.ofSeconds(10)); 
WebElement elementProd44 = wait6.until(ExpectedConditions.elementToBeClickable(By.xpath("//button[text()='Filters']")));
elementProd44.click();

If you get the same issue, then use the JavascriptExecutor to click

WebElement button = driver.findElement(By.xpath("//button[text()='Filters']"));
JavascriptExecutor executor = (JavascriptExecutor)driver;
executor.executeScript("arguments[0].click();", button);
Sign up to request clarification or add additional context in comments.

5 Comments

Hey pal, thanks for replying!. I'm getting this error: "Exception in thread "main" org.openqa.selenium.ElementClickInterceptedException: element click intercepted: Element <button class="action-default" data-action="grid-filter-expand" data-bind="css: {_active: hasVisible() &amp;&amp; $collapsible.opened()}, disable: !hasVisible(), i18n: '...', toggleCollapsible">Filters</button> is not clickable at point (522, 265). Other element would receive the click: <div data-role="spinner" data-component="company_listing.company_listing.company_columns" class="admin__data-grid-loading-mask">...</div>"
I tried both options, no one really worked :/
Is it possible to share the url? code should have worked.
Pal, the problem is in here. (By.xpath("//button[text()='Filters']") Is there any other way to define the xpath?
Could you please list all the different way to invoke that button by it's xpath or a different way?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.