WaitForObjectWithText does not work with multiple element matches
In what language are the test written? C#
What version of Unity are you using? 2018.4
What version of AltUnityTester are you using? 1.2.7
On what device are you trying to run the test? Android, iOS
The OS from where you are running the test? macOS
WaitForObjectWithText does not work in cases where there are multiple elements matched by the By/value combination.
Driver.WaitForObjectWithText(By.NAME, "TitleElement", title);
If there are 2 elements that match the By.NAME "TitleElement", the function will not iterate through available elements, and will instead only try and wait for the first element to eventually match.
The reason for that seems to be because the text validation is not included in the initial check. The logic for this function seems to be:
- Find element that matches the By/value
- Check if the text matches the expected text
- if not, wait and retry
Are there any workarounds for that? Would it be possible to use path and something like "//TitleElement[@text='title']"?
Steps to reproduce
Try to use the .WaitForObjectWithText() that matches multiple results
Relevant logs and/or screenshots
(Please offer logs and screenshots with the problem. Cover everything that is confidential)