austgl / robotium

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

"EditText with index 0 is not available!" doesn't work with Android 2.1 SDK #181

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
Below are the test steps that work fine for Android 2.2 and Android 2.3.3. But 
fails on Android 2.1(API level 7)
1. Application Layout has the definition as follows for the search
<Button
        android:id="@+id/text_search_field"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="5dip"
        android:paddingRight="32dip"
        android:hint="@string/common_search_hint"
        android:textAppearance="?android:attr/textAppearanceMediumInverse"
        android:textColor="@android:color/primary_text_light"
        android:focusableInTouchMode="false"
        android:freezesText="true"
        android:singleLine="true"
        android:ellipsize="end"
        style="?android:attr/editTextStyle" />

2. From test case, I want to provide a value in the search box. So I did the 
following
                        solo.clickOnView(solo.getActivity().findViewById(com.ebay.mobile.R.id.text_search_field));
                        solo.clearEditText(0);
            solo.enterText(0, "ipod");
            solo.sendKey(Solo.ENTER);

or I also tried

            solo.clearEditText((EditText)b.findViewById(com.ebay.mobile.R.id.text_search_field));
            EditText editText = (EditText)  solo.getView(com.ebay.mobile.R.id.text_search_field);
                        solo.enterText(editText, "ipod");
                        solo.sendKey(Solo.ENTER);

3. In the test application AndroidManifest.xml file I did specify the following
     <supports-screens android:anyDensity="true"/>
    <uses-sdk android:minSdkVersion="4" />
    <uses-sdk android:targetSdkVersion="7"/>

What is the expected output? What do you see instead?
Expected output:- The search box should contain the value "ipod" and should 
display the results
Actual output:- Displays error message "junit.framework.AssertionFailedError: 
EditText with index 0 is not available!"

What version of the product are you using? On what operating system?
OS :- MAC
Robotium:- 2.5
Fails on Android SDK 2.1 and works fine on Android SDK 2.2 and 2.3.3

Note:- I also looked at the below forum questions and tried. But nothing 
worked. Any suggestions or help is appreciated.
http://groups.google.com/group/robotium-developers/browse_thread/thread/4787d161
25372f36
http://stackoverflow.com/questions/3544445/problem-of-robotium

Original issue reported on code.google.com by koneru.s...@gmail.com on 6 Nov 2011 at 10:44

GoogleCodeExporter commented 9 years ago
The SDK version is not the reason for your issues, its more probable that it is 
a timing issue. Robotium 3.0 will be released in a few days. Hopefully this 
issue will be fixed in that release.  

Original comment by renasr...@gmail.com on 7 Nov 2011 at 11:25

GoogleCodeExporter commented 9 years ago
I have to test my app on Android V 2.1,2.2. and 2.3.3.
As mentioned the tests work for Android-2.2 and Android-2.3.3. So should I 
ignore runing tests on 2.1 or it will be great if you can provide some 
suggestion that I can try?

Original comment by koneru.s...@gmail.com on 8 Nov 2011 at 12:06

GoogleCodeExporter commented 9 years ago
I have the same problem while using Robotium with Android2.1/1.6/1.5
and I have already updated the robotium to 3.0,but nothing worked.Any 
suggestion?

Original comment by eric.c...@dianping.com on 16 Nov 2011 at 8:17

GoogleCodeExporter commented 9 years ago
The activity where the edit text is located needs to belong to your
application. Please see the QA wiki page.

Original comment by renasr...@gmail.com on 16 Nov 2011 at 8:28

GoogleCodeExporter commented 9 years ago
Hi Renas, I downloaded latest robotium 3.0 and still face the same issue with 
Android 2.1.
I am testing eBayMobile app, the usecase is simple, to search for "ipod"(the 
search exists on main activity) and click enter.
As described above, #2 logic still fails.
Any suggestions or pointers will be great. 

Original comment by koneru.s...@gmail.com on 29 Dec 2011 at 8:00

GoogleCodeExporter commented 9 years ago
Hi Renas, any suggestions...

Original comment by koneru.s...@gmail.com on 3 Jan 2012 at 6:09

GoogleCodeExporter commented 9 years ago
I have no idea at all why it would fail on Android 2.1. And unfortunately there 
is nothing I can do about it. The way in which Robotium works is similar for 
all the versions. So there is no reason from a Robotium perspective why it 
would not work on 2.1. Also nothing can be changed in the Robotium code that 
would fix this issue.  Its a platform specific issue. 

Original comment by renasr...@gmail.com on 3 Jan 2012 at 6:42