I’ve finally had a chance to play with this again and I’m still noticing some weirdness.
We have a customized UISegmentedControl controlled by 4 tabs. Each tab contains a scrollable table view that usually displayed about 6 cells.
When I call find_ele_by_attr :UIATableCell, :name, example name, it doesn’t behave the same every time (using arc). The first time it usually fails with:
Selenium::WebDriver::Error::UnknownError: elementId 67 could not be tapped
If I run the command again, it fails about 50% of the time, but the elementId increments.
It has succeeded every time so far on the third attempt.
Is there any reason why the collection of elements being returned is changing, even through app state is not changing?
[28] pry(main)> finds("Message")[0].click
post /elements
{
:using => "xpath",
:value => "//*[@visible=\"true\" and (contains(translate(@name,\"MESSAGE\",\"message\"), \"message\") or contains(translate(@hint,\"MESSAGE\",\"message\"), \"message\") or contains(translate(@label,\"MESSAGE\",\"message\"), \"message\") or contains(translate(@value,\"MESSAGE\",\"message\"), \"message\"))]"
}
post /element/92/click
Selenium::WebDriver::Error::UnknownError: elementId 92 could not be tapped
from /Users/jmiele/.rvm/gems/ruby-2.1.3/gems/selenium-webdriver-2.43.0/lib/selenium/webdriver/remote/response.rb:52:in `assert_ok'
[29] pry(main)>
[30] pry(main)>
[31] pry(main)>
[32] pry(main)> finds("Message")[0].click
post /elements
{
:using => "xpath",
:value => "//*[@visible=\"true\" and (contains(translate(@name,\"MESSAGE\",\"message\"), \"message\") or contains(translate(@hint,\"MESSAGE\",\"message\"), \"message\") or contains(translate(@label,\"MESSAGE\",\"message\"), \"message\") or contains(translate(@value,\"MESSAGE\",\"message\"), \"message\"))]"
}
post /element/98/click
""