RobotiumTech / robotium

Android UI Testing
http://www.robotium.org
Apache License 2.0
2.86k stars 786 forks source link

clickOnText(String text, int match) fails on emulator 4.3 #690

Closed renas closed 9 years ago

renas commented 9 years ago

From ramda...@gmail.com on June 05, 2014 09:54:04

What steps will reproduce the problem? 1. Run test having API call to click on second instance of a particular text in a screen [Ideally first instance is screen title and second instance is the field element] 2. 3. What is the expected output? What do you see instead? It should click on the field element having the matching text What version of the product are you using? On what operating system? Robotium-solo 5.1 Please provide any additional information below. In other version of Android emulator, it is working perfectly fine. [Ex: 4.0, 2.3 etc] Not sure whether it tries clicking on title instead of second instance, but second it just skips this API and goes to next line of code.

Original issue: http://code.google.com/p/robotium/issues/detail?id=611

renas commented 9 years ago

From renasr...@gmail.com on June 06, 2014 03:11:08

Thanks for reporting this. Does it work on the 4.4 emulator?

Owner: renasr...@gmail.com

renas commented 9 years ago

From ramda...@gmail.com on June 06, 2014 08:31:16

Hi Renas, Thanks for quick reply. Tried the same tests on 4.4.2 emulator and faced the same problem. But same tests passed on 4.2.2 emulator.

Looks like its breaking from 4.3 onwards.

renas commented 9 years ago

From renasr...@gmail.com on June 07, 2014 13:13:21

What happens if you try to decrease or increase the index (the instance number)?

renas commented 9 years ago

From ramda...@gmail.com on June 11, 2014 22:44:19

Hi Renas, Tested with decreasing instance number, below is the observation :

In 4.3 onwards, Screen title is ignored and index starts on first element in the screen with matching text. It means, if a screen has a matching text in screen title and in other parts of screen, 4.2 and before, index =1, maps to screen title. But in 4.3, index=1 maps to first matching text in screen [excl screen title] which would be identified in 4.2 or earlier version as index=2.

We can temporarily fix it in our scripts by using SDK version and updating index, which is not right way. It will be very helpful, if you can handle it in Robotium code.

renas commented 9 years ago

From renasr...@gmail.com on June 11, 2014 22:57:11

Thanks for the information. What Robotium does is to ask the Android platform for the Views belonging to the app under test. In this case there seems to be differences in the Android versions which results in the title view not being available to Robotium in Android 4.3. Unfortunately we can not do anything about that. We can only rely on what the platform gives us.

Status: WontFix

renas commented 9 years ago

From ramda...@gmail.com on June 11, 2014 23:21:22

Thank for Quick comment. We will try to apply customized fix it at our end :(