1

In Robotium :- I am writing automation scripts using Solo class. Now i have to verify the images in my application.

For texts we can use Assert.assertTrue(solo.searchText("rtf"));

For images, is there any command in Robotium Solo Class?

Nikos Paraskevopoulos
  • 39,514
  • 12
  • 85
  • 90
Rahul Mendiratta
  • 615
  • 1
  • 6
  • 14

2 Answers2

2

Not really. Most suggested way to test (its meaning may vary) ImageViews is given by:

  • In code under test, set something in the ImageView tag that you want to check later. E.g. the drawable resource Id.
  • In test code, get whatever you set in the tag, and verify it has the expected value.

Also, you may want to have a look at this discussion on some other method to visually check the image.

superjos
  • 12,189
  • 6
  • 89
  • 134
1

You can try this:

assertTrue(solo.getCurrentActivity().getResources().getDrawable(R.drawable.logo).isVisible());

For more: https://stackoverflow.com/a/26114862

Community
  • 1
  • 1
Kamil Seweryn
  • 2,072
  • 2
  • 17
  • 23