Webdriver element not clickable exception

83 views
Skip to first unread message

jit...@vizru.com

unread,
Sep 24, 2017, 11:39:29 PM9/24/17
to webdriver
I am trying to automate a dynamic web application which contains a lot of ajax contents. I am using explicit wait web driver wait condition for finding the element . but sometimes i get the Error element not clickable at point error . That is the element is visible but the other element is recieving the click. 

My code is 
wait.until(ExpectedConditions.elementToBeClickable(By.cssSelector("#ls_10704_9985 > div.dashActions > div > a.edit.ajax.ls_edit")));

i tried visibility of element too .. but still at sometimes i get the same error .. what is the right way for waiting for a element thank you ..

Øystein Torvund

unread,
Oct 3, 2017, 7:14:01 AM10/3/17
to webd...@googlegroups.com
Hi

Try debugging it and go line by line. If that works (and it probably will) you know it is a timing issue. If you still cannot click it there is another element covering the target element and you need to figure out what that is. if you can click it using debugging it is a timing issue and you need to figure out what is loading and wait correctly.

It is not enough to just wait for the element you want to click. You need to make sure everything is loaded. And Loaded correctly.


From: webd...@googlegroups.com <webd...@googlegroups.com> on behalf of jit...@vizru.com <jit...@vizru.com>
Sent: Monday, September 18, 2017 9:39 AM
To: webdriver
Subject: [webdriver] Webdriver element not clickable exception
 
--
You received this message because you are subscribed to the Google Groups "webdriver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to webdriver+...@googlegroups.com.
To post to this group, send email to webd...@googlegroups.com.
Visit this group at https://groups.google.com/group/webdriver.
For more options, visit https://groups.google.com/d/optout.

Haden J-Robbins

unread,
Oct 19, 2017, 12:18:16 PM10/19/17
to webdriver
Basically, what Austin said.

If you do discover that it is a timing issue, then this one of the classic 'gotchas' with Selenium. What I do in this situation is have a loop which attempts the action we're trying to carry out on the element, such as a click, but do this within a try catch block. Then, if the exception is not thrown, you know that the action has been successful and you break out of the loop.

If, after a certain number of iterations through the loop (you put a thread.sleep at the end of the exception handling code), you are still getting an exception thrown every time, then you throw your own exception to stop the test as there is clearly another issue causing a problem now - spmething is obscuring your element.
Reply all
Reply to author
Forward
0 new messages