Note that there are some explanatory texts on larger screens.

plurals
  1. POrobotium pressMenuItem or clickOnMenuItem not working
    text
    copied!<p>I use SherlockActionBar. I have 3 menu entries. 1st is always shown, the others have text and no icons so they are in menu. I run the test several times. First time it works pretty good but the other times it fails because of</p> <pre><code>04-19 16:43:14.326: D/Robotium(22310): 'Disable layers' not found. Have found: 'Layer_3' 04-19 16:43:15.247: I/TestRunner(22310): ----- begin exception ----- 04-19 16:43:15.267: I/TestRunner(22310): junit.framework.AssertionFailedError: Text string: 'Disable layers' is not found! 04-19 16:43:15.267: I/TestRunner(22310): at junit.framework.Assert.fail(Assert.java:47) 04-19 16:43:15.267: I/TestRunner(22310): at junit.framework.Assert.assertTrue(Assert.java:20) 04-19 16:43:15.267: I/TestRunner(22310): at com.jayway.android.robotium.solo.Clicker.clickOnText(Clicker.java:339) 04-19 16:43:15.267: I/TestRunner(22310): at com.jayway.android.robotium.solo.Clicker.clickOnMenuItem(Clicker.java:199) 04-19 16:43:15.267: I/TestRunner(22310): at com.jayway.android.robotium.solo.Solo.clickOnMenuItem(Solo.java:763) </code></pre> <p>pressMenuItem produces the same result. Why it can't access the menu during the secound launch? The menu even isn't opened. It's strange..</p> <p>EDITED: I use last robotium 4.1. Code:</p> <pre><code> View imageBehind = solo.getView(R.id.image_view_behind); View imageTop = solo.getView(R.id.image_view_top); solo.clickOnMenuItem(solo.getString(R.string.disable_sbl)); assertTrue(imageBehind.getVisibility() == View.GONE); solo.clickOnMenuItem(solo.getString(R.string.disable_stl)); assertTrue(imageTop.getVisibility() == View.GONE); solo.clickOnMenuItem(solo.getString(R.string.enable_sbl)); assertTrue(imageBehind.getVisibility() == View.VISIBLE); solo.clickOnMenuItem(solo.getString(R.string.enable_stl)); assertTrue(imageTop.getVisibility() == View.VISIBLE); </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload