austgl / robotium

Automatically exported from code.google.com/p/robotium
0 stars 0 forks source link

pressSpinnerItem(spinnerIndex, optionIndex) does not work correctly on Android 2.2 #114

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
Case A:
1. Use Android 2.2
2. Have a SpinnerView with more than 2 items
3. Call Solo.pressSpinnerItem(0, 1);

Case B:
1. Use Android 2.2
2. Have a SpinnerView with more than 2 items
3. Call Solo.pressSpinnerItem(0, 2);

What is the expected output? What do you see instead?
Case A:
expected:
3. The spinner goes one option down
instead:
3. The spinner doesn't go one option down

Case B:
expected:
3. The spinner goes two options down
instead:
3. The spinner goes one option down

What version of the product are you using? On what operating system?
Robotium 2.2 or 2.3, Android 2.2 

Please provide any additional information below.

The function Solo.pressSpinnerItem(spinnerIndex, optionIndex);

works correctly on Android 1.6 (ex: G1) but does not work properly on Android 
2.2 (ex. HTC Desire).

Original issue reported on code.google.com by JoaRe...@gmail.com on 20 May 2011 at 8:51

GoogleCodeExporter commented 9 years ago
Does it work on the 2.2 emulator?

Original comment by renasr...@gmail.com on 20 May 2011 at 10:38

GoogleCodeExporter commented 9 years ago

Original comment by renasr...@gmail.com on 23 May 2011 at 6:47

GoogleCodeExporter commented 9 years ago
Same behaviour on the emulator.
I attached a sample project and a sample test project.

Original comment by JoaRe...@gmail.com on 23 May 2011 at 8:54

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for this. It will be corrected in the next release.

Original comment by renasr...@gmail.com on 23 May 2011 at 10:52

GoogleCodeExporter commented 9 years ago
This has been corrected in Robotium 2.4.

Original comment by renasr...@gmail.com on 13 Jul 2011 at 5:26

GoogleCodeExporter commented 9 years ago
I'm using Robotium 2.4 and I'm having similar issues where pressSpinnerItem 
works on Android 1.5 (emulator & device), but not on Android 2.1 and up 
(emulator & device).  

On Android 2.1 and up, the spinner is selected, but is never opened in order to 
select the item at the specified index.  So the first item in the list is 
always selected.

I tried different alternatives:
-clicking on the spinner view followed by clicking on the text in question
-clicking on the location of the spinner on the screen followed by clicking on 
the text in question
Each of these alternatives work on Android 1.5, but not on Android 2.1 and up.  
The spinner is never opened in order to select the item in question.

Original comment by mary.mik...@gmail.com on 15 Aug 2011 at 10:17

GoogleCodeExporter commented 9 years ago
For the sake of completion, I downloaded the sample project and test project 
attached to this issue to try running them in my environment and I realized 
that the tests themselves do not adequately validate the spinner item 
selection.  

In fact, the 
if (!solo.waitForText("startPlus1")) 

is always true regardless of the index passed in the pressSpinnerItem call 
because the spinner is opened but never closed.  The 
solo.waitForText("startPlus1") is performed while the spinner is open instead 
of validating the text that should displayed in the toast once the item is 
selected.

Therefore, there is still an issue with the pressSpinnerItem not working 
properly on Android 2.x

Please let me know whether or not I need to create a new issue for this.
Thanks!

Original comment by mary.mik...@gmail.com on 25 Aug 2011 at 5:25

GoogleCodeExporter commented 9 years ago
Please see: Why do button klicks get wrong on the QA wiki page. 

Original comment by renasr...@gmail.com on 25 Aug 2011 at 5:54

GoogleCodeExporter commented 9 years ago
I am using solo.pressSpinerItem (0, 2). When he performs, he does not open the 
items from the spinner, it goes to the next two compontes of screen that are a 
check box and a button and clicking the button. Anyone know what can be?

Original comment by eder...@gmail.com on 31 Jan 2012 at 6:39

GoogleCodeExporter commented 9 years ago
Please see: "Why do text and button clicks get wrong?"

http://code.google.com/p/robotium/wiki/QuestionsAndAnswers

Original comment by renasr...@gmail.com on 31 Jan 2012 at 7:21