lundi 18 mai 2015

Unable to locate UI Object using UiAutomatorView in android.webkit.WebView class

I am working on a small android automation assignment. I am writing automation code to test the initial device start up process (When you take out device out of box and switch on for first time). One of the sates is when we have to enter Google account credentials for which email and password fields are encompassed in android.webkit.WebView class. I am not able to access email and password field using UiAutomatorview. Being unable to access, hence I can't enter actual inputs in those fields. Also since this is just kind of a booting up a device, can't run any other app that will help me identify UI components.

Did anyone faced similar problem and able to overcome it ? I tried following way to locate the object BUT that also does not return any UI object

UiObject2 googleAccName = mUiDevice.findObject(By.text("Enter your email"));

if( googleAccName != null && 
    googleAccName.isEnabled() && 
    googleAccName.isClickable()) {

    googleAccName.click();
    googleAccName.setText("xxxxx@gmail.com");
}
else {
    Log.e(TAG, "No Text field to enter email found !!");
    Assert.fail("failed to setup google account");
}

Aucun commentaire:

Enregistrer un commentaire