0

I'm sporadically receiving the following:

Selenium::WebDriver::Error::UnknownError: unknown error: Element <tr _ngcontent-c7="">...</tr> is not clickable at point (1101, 18). Other element would receive the click: <div _ngcontent-c1="" class="col-md-6">...</div>
  (Session info: chrome=64.0.3282.140)
  (Driver info: chromedriver=2.33.506120 (e3e53437346286c0bc2d2dc9aa4915ba81d9023f),platform=Windows NT 6.1.7601 SP1 x86_64)

This occurs from a page that has a table where the rows extend past the viewpoint.

the method that I'm using to select a random row in the table

def get_random_row
  random_row = rand(1..self.policy_results_row_count)
  row = self.policy_results_element.row_element(:index => random_row)
  row.focus
  self.wait_until(10, 'Row not in focus') do
     row.visible?
  end
row.click 
end

Is there a way to check to see if an element within Viewport after #focus?

niartseoj
  • 112
  • 7
  • 2
    Possible duplicate of [Is there a way to determine if an element is clickable in Chrome Browser using Selenium and Watir?](https://stackoverflow.com/questions/50644727/is-there-a-way-to-determine-if-an-element-is-clickable-in-chrome-browser-using-s) – orde Jun 21 '18 at 16:17
  • thanks orde. I did not see that in my initial search. What I'm observing is with a scrolling page. I confirmed this by running the script 100 times using two separate accounts. One where the table scrolled out of viewpoint and the other where the table contained all rows in the viewpoint. Any thoughts on a focus and viewpoint in chrome? – niartseoj Jun 21 '18 at 16:28
  • @niartseoj, do you know what that overlapping element is? Is it a static content that floats at the top or bottom? – Justin Ko Jun 21 '18 at 16:47
  • yes Justin thank you it appears to be a menu that is at the top of the page. the div has a class appears to be unique and static. It does not every disappear so my step of row.focus scrolls but the menu is still overlaying.. – niartseoj Jun 21 '18 at 18:01

1 Answers1

1

The fact that it is or is not in the viewport makes no difference inherently. What will make a difference is how the responsive design of the CSS is working for your application at different resolutions. You can change the window size if that makes a difference. If the issue is that there is a static header that the element is hiding under, you can use the excellent watir-scroll gem to move the element out from under the static header.

titusfortner
  • 4,099
  • 2
  • 15
  • 29
  • thank you titusfortner.. what i did was trap the error and then element.preceding_sibling.scroll_into_view agree the watir-scroll gem looks much cleaner .. – niartseoj Jun 21 '18 at 18:28