anandmeher / robotium

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

All apis with resource id are not work #607

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The following codes works well.

EditText t1 = solo.getEditText("Event name");
solo.enterText(t1, "abcdefg");
===============================================================
But if I change it to 
solo.enterText(com.android.calendar.R.id.title, "abcdefg");
The results will be 
junit.framework.AssertionFailedError: 2131755035 EditTexts are not found!
    at com.robotium.solo.Waiter.waitForAndGetView(Waiter.java:537)
    at com.robotium.solo.Solo.enterText(Solo.java:1719)

The log output 

Log.v("uta", "textedit id=" +String.valueOf(t1.getId()) + " name=" + 
t1.getResources().getResourceEntryName(t1.getId()));
Log.v("uta", "textedit id from res id=" + 
String.valueOf(com.android.calendar.R.id.title));

05-15 05:19:49.110: V/uta(6200): textedit id=2131755034 name=title
05-15 05:19:49.180: V/uta(6200): textedit id from res id=2131755034

The issue exists on other widgets and APIs.

The junit.framework.AssertionFailedError: xxxxx is always larger than the real 
id 1, but it is also not work if I make a workaround.

What version of the product are you using? On what operating system?
I am working on emulator and modifying aosp calendar. the robotium version is 
5.1

Please provide any additional information below.

Original issue reported on code.google.com by suo...@gmail.com on 15 May 2014 at 9:43

GoogleCodeExporter commented 9 years ago
Use solo.getView() if you want to work with resource ID:s

Original comment by renasr...@gmail.com on 16 May 2014 at 5:38