sangmingming / robotium

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

I am getting one crash after calling any robotium api after launching my activity #104

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.After calling constructing the solo object in the setup -> mySolo = new 
Solo(getInstrumentation(), getActivity());
2.Now just check my simple code:

public  void test_BasicTest() throws Exception {
   solo.sleep(2000);
   solo.searchText("android");
   solo.clickOnText("android");
}

What is the expected output? What do you see instead?
Should be able to perform any operation.

Actual:
Is giving null pointer exception.

What version of the product are you using? On what operating system?
Gingerbread 2.3 and Robotium2.2

Please provide any additional information below.

Original issue reported on code.google.com by anandpai...@gmail.com on 19 Apr 2011 at 11:22

Attachments:

GoogleCodeExporter commented 9 years ago
Could u please tell me what is the problem here.

Original comment by anandpai...@gmail.com on 19 Apr 2011 at 11:23

GoogleCodeExporter commented 9 years ago
The problem here is that you try to interact with the activity/application 
before it is ready. Please use waitForX() in order to make sure that the GUI is 
ready before trying to interact with it.

Original comment by renasr...@gmail.com on 19 Apr 2011 at 12:00

GoogleCodeExporter commented 9 years ago
Hi Renas,

     I have used as you told me but it is giving me some other exception - "IllegalMonitorStateException"

Original comment by anandpai...@gmail.com on 19 Apr 2011 at 12:18

Attachments:

GoogleCodeExporter commented 9 years ago
I ran into this in a more complex situation and solved it by :

  synchronized(solo) {
     solo.sleep(2000);
  }

More going on under the covers but this should solve your problem

Original comment by grnd...@gmail.com on 31 Jul 2013 at 7:24