Element is not clickable at point, ruby

382 views
Skip to first unread message

Den Dem

unread,
Jul 13, 2015, 2:20:12 PM7/13/15
to webd...@googlegroups.com

I am using Rspec, Selenium Webdriver, Ruby, Mac OSx When I execute script for Firefox, everything goes smooth. When I do change to Chrome Version 43.0.2357.130, there is error

>      unknown error: Element is not clickable at point (385, 575). Other element would receive the click: <div class="ajax-progress
> ajax-progress-throbber">...</div>
>        (Session info: chrome=43.0.2357.130)
>        (Driver info: chromedriver=2.15.322455 (ae8db840dac8d0c453355d3d922c91adfb61df8f),platform=Mac OS X 10.10.4
> x86_64) (Selenium::WebDriver::Error::UnknownError)

I tried to add wait time, also with research, I found out for Java there is possibility to do with JavascriptExecutor.

Would possible to do something in Ruby?

SuperKevy

unread,
Jul 14, 2015, 9:35:15 AM7/14/15
to webd...@googlegroups.com
Looks like an overlay element is displayed while some activity is completing.    
So does the div ever disappear?  I assume it does.  
Maybe something similar to:
while browser.div(:class,"ajax-progress ajax-progress-throbber").present?  do  #or visible? or exists?
  sleep 1
  puts ' - Waiting for process to complete'
end
Then do your click....

darrell

unread,
Jul 14, 2015, 2:03:18 PM7/14/15
to webd...@googlegroups.com
SuperKevy is most likely correct. The proper way to automate this would be:

- go to the page
- WAIT for the ajax process to finish
- click the element

A lot of times people don't realize they are waiting for things to finish. If you test it manually you are probably so slow that the WAIT time is literally 0 seconds. In the case of Firefox it will probably wait one loop then continue. With Chrome it might take two or three loops. Also, in Java there a WebDriverWait. This is really helpful in these cases. I use WebDriverWait which has an .until() method. This method can take as input a ExpectedConditions.invisibilityOfElementLocatedBy(). So the end result is I can wait until the Ajax progress throbber disappears. Something like:

WebDriverWait wdw = new WebDriverWait(driver, 10);
wdw.until(ExpectedConditions.invisibilityOfElementLocatedBy(By.cssSelector(".ajax-progress.ajax-progress-throbber")));

maybe there is an equivalent class in Ruby.

Rafael s

unread,
Jul 22, 2015, 10:02:33 AM7/22/15
to webdriver
Reply all
Reply to author
Forward
0 new messages