junit.framework.AssertionFailedError while testing back button on android -


i new robotium.i'm facing issue "junit.framework.assertionfailederror" while executing test case using robotium.test scenario checking button functionality.here's code

    package com.example.test; import android.test.activityinstrumentationtestcase2; import android.widget.edittext;  import com.jayway.android.robotium.solo.solo; import com.example.app.r; import com.example.app.loginactivity; import com.example.app.accountcardlistactivity; import com.example.app.receiptlistactivity; import com.example.app.withdrawallistactivity;   public class back_concerto_425 extends activityinstrumentationtestcase2<loginactivity>{         public back_concerto_425() {         super(loginactivity.class);         // todo auto-generated constructor stub     }       private solo solo;       protected void setup() throws exception     {         solo = new solo(getinstrumentation(), getactivity());      }      public void testbackbutton()     {          solo.entertext(0, "username");         solo.entertext(1, "password");         solo.clickonbutton(0);         solo.waitforactivity("com.example.app.withdrawallistactivity", 3000);         asserttrue(solo.searchtext("withdrawllistactivity"));         solo.clickonbutton("view receipts");         solo.waitforactivity("com.example.app.receiptlistactivity",3000);         asserttrue(solo.searchtext("receipts"));         solo.gobacktoactivity("com.example.app.withdrawallistactivity");         asserttrue(solo.searchbutton("view receipts"));         asserttrue(solo.searchbutton("new withdrawal"));       }       public void teardown() throws exception     {          try         {             solo.finalize();         }         catch (throwable e)         {             e.printstacktrace();         }          super.teardown();     }      } 

here's error log

[info]     start [15/16]: com.ncr.mobile.mcw.test.withdrawllistactivitytest#testreceiptsbutton [info]     failure:com.ncr.mobile.mcw.test.withdrawllistactivitytest#testreceiptsbutton [info]     junit.framework.assertionfailederror @ com.ncr.mobile.mcw.test.withdrawllistactivitytest.testreceiptsbutton(withdrawllistactivitytest.java:45) @ java.lang.reflect.method.invokenative(native method) @ android.test.instrumentationtestcase.runmethod(instrumentationtestcase.java:214) @ android.test.instrumentationtestcase.runtest(instrumentationtestcase.java:199) @ android.test.activityinstrumentationtestcase2.runtest(activityinstrumentationtestcase2.java:192) @ android.test.androidtestrunner.runtest(androidtestrunner.java:190) @ android.test.androidtestrunner.runtest(androidtestrunner.java:175) @ android.test.instrumentationtestrunner.onstart(instrumentationtestrunner.java:555) @ android.app.instrumentation$instrumentationthread.run(instrumentation.java:1584) 

please let me know if there mistake in code.

once 1 of friend faced same problem resolved giving timeout period,similarly haven't mentioned timeout period in waitactivity method or using waitactivity method without timeout argument.

hope helps


Comments

Popular posts from this blog

python - How to create a legend for 3D bar in matplotlib? -

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -