Hi Dave,
Please find updated patch with following changes:
1) Locate grid row by div's style attribute 'top'(i.e. 'top:0px' for first row), instead of by div class-name because the order of rendered rows is not always same.
2) Increase the wait timeout of WebDriverWait to 5 seconds in '_compare_cell_value(...)' method.
3) Add a new utils method 'find_by_css_selector' in pgadmin_page.py to locate css element with wait_for method.
4) Add a new utils method 'wait_for_element_to_stale' in pgadmin_page.py. It is useful when "StaleElementReferenceException" exception is raised and element is not attached to the page while finding element by xpath.
5) Instead of finding each cell value by xpath and compare with actual value, now a row is located using xpath and all of cell values are extracted into an array and then compared with actual values. It eliminates the use of wait_timeout.
Also, I added a print statement for debugging where a TimeoutException was occurred last time.