stephenwang1011 / robotium

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

getString() method is returning the value of textview as false. #292

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. get the value of textview by using method String XYZ = 
solo.getString(R.id.xyz).
2. print the value of XYZ using Log.d("Robotium", "text: " + XYZ );

What is the expected output? What do you see instead?
Expected output: in the log it should give the value of the textview as shown 
on the device's screen.
Actual output: it print the valus as "false" in the logs, which is incorrect.

What version of the product are you using? On what operating system?
Robotium 3.3 on Android 2.3.3.

Please provide any additional information below.
In Hierarchyviewer, this value of textview is displaying successfully. This 
textview is a counter which keeps on incrementing after performing a particular 
action.

Original issue reported on code.google.com by vaca...@gmail.com on 4 Jul 2012 at 12:09

GoogleCodeExporter commented 9 years ago
I think your issue is that you are using getString() at the wrong time. You 
need to call it when the right activity is active. What getString does is to 
ask the current activity for a resource id string. That is all.

Original comment by renasr...@gmail.com on 5 Jul 2012 at 4:03