UIAutomator facebook login

醉酒当歌 提交于 2019-12-10 22:33:34

问题


I created a UIAutomator login test for my app, and it works on some of the emulators. Problem is, it doesnt work on all of them.

    UiObject input = mDevice.findObject(new UiSelector().instance(0).className(EditText.class));
    input.setText(getFacebookLoginEmail());
    SystemClock.sleep(2000);

    UiObject input2 = mDevice.findObject(new UiSelector().instance(1).className(EditText.class));
    input2.setText(getFacebookLoginPassword());
    SystemClock.sleep(2000);

    UiObject buttonInput = mDevice.findObject(new UiSelector().instance(0).className(Button.class));
    buttonInput.click();
    SystemClock.sleep(2000);

Thats the code im currently using, most emulators run trough it just fine but on some, it doesnt type anything on the fields. I have a suspicion it might be caused by the emulator having different Facebook version, making the login page webview. For reference, on API 23 emulator it works, on API 22 one it doesnt.

来源:https://stackoverflow.com/questions/38764458/uiautomator-facebook-login

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!