RobotiumTech / robotium

Android UI Testing
http://www.robotium.org
Apache License 2.0
2.86k stars 786 forks source link

Not able to retrieve the label/Hint of the editText using robitum. #790

Open PrabhatPandey opened 9 years ago

PrabhatPandey commented 9 years ago

Here is the testCase which I wrote to assert whether that particular EditText hint/Label is visible or not.

public void testIfInTheProfileSetUpScreenAllTheBackgroundTextAreVisible() {

                 //Login activity.
             solo.enterText(0, Utility
            .getThisString(R.string.default_owner_login_phone_number,
                    getInstrumentation()));
    solo.enterText(1, Utility.getThisString(
            R.string.default_owner_login_password, getInstrumentation()));
    View view = solo.getView(Utility.getThisString(
            R.string.login_button_id, getInstrumentation()));
    solo.clickOnView(view); assertEquals(true, solo.searchText("Site"));

//After logging in It goes to the profile set up page where I want to assert that particular Hint/Lable is visible or not. Screen shot is attached. }

How to resolve this issues. screenshot_2015-10-20-13-07-27

I get this error after running the test case. junit.framework.AssertionFailedError: expected: but was: at com.iryd.TestIRYDDeliveryApplication.testIfInTheProfileSetUpScreenAllTheBackgroundTextAreVisible(TestIRYDDeliveryApplication.java:236) at java.lang.reflect.Method.invokeNative(Native Method) at android.test.InstrumentationTestCase.runMethod(InstrumentationTestCase.java:214) at android.test.InstrumentationTestCase.runTest(InstrumentationTestCase.java:199) at android.test.ActivityInstrumentationTestCase2.runTest(ActivityInstrumentationTestCase2.java:192) at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:191) at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:176) at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:554) at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1701)

PrabhatPandey commented 9 years ago

Does anybody have any idea regarding this ?