Check that the element is clickable or not in Selenium WebDriver

0 votes

I have automated web applications that are very heavy on Ajax. 

Like a modal dialog is displayed with the text "Saving..." when it is saving the settings, while the rest of the page greys out

My test scripts are trying to click the next link in the test before the message disappears. It almost always works when driving Firefox, but when driving Chrome the following error is displayed:

Exception in thread "main" org.openqa.selenium.WebDriverException: Element is not clickable at point (99.5, 118.5). Other element would receive the click: <div class="dijitDialogUnderlay _underlay" dojoattachpoint="node" id="lfn10Dijit_freedom_widget_common_environment_Dialog_8_underlay" style="width: 1034px; height: 1025px; "></div> (WARNING: The server did not provide any stacktrace information)

Is there a way to detect if the element is clickable or not? 

Jun 12, 2018 in Selenium by Sahiti
• 6,370 points
34,225 views

2 answers to this question.

0 votes

Use Selenium Waits:

    WebDriverWait wait = new WebDriverWait(yourWebDriver, 5);
    wait.until(ExpectedConditions.elementToBeClickable(By.xpath("//xpath_to_element")));

Webdriver will wait for 5 seconds for the element to be able to be clicked.

Hope this helps!

Join selenium training today to learn from the expert!

answered Jun 12, 2018 by Meci Matt
• 9,460 points
+1 vote

Hi ,

you want to know only is that element is clickable r not .so

u have to check element properties like IsVisable , IsEnabled etc.

For further understanding, you can refer to the Selenium Course.

answered Aug 31, 2020 by Sri
• 3,190 points

Related Questions In Selenium

0 votes
1 answer

To check that the web page is loaded or not using Selenium Web Driver?

The solution is using Implicit Wait which ...READ MORE

answered May 24, 2018 in Selenium by Meci Matt
• 9,460 points
25,156 views
0 votes
1 answer
0 votes
2 answers

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,500 points
13,731 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

enable trusted connection  in internet explorer by ...READ MORE

answered Aug 31, 2020 in Selenium by Sri
• 3,190 points
9,171 views
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,910 points
7,247 views
0 votes
2 answers

How to use such xpath to find web elements

xpath are two types. 1) Absolute XPath:    /html/b ...READ MORE

answered Sep 3, 2020 in Selenium by Sri
• 3,190 points
7,887 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP