• 赞,期待流量回放部分的详细介绍

  • 埋点管理开源了吗

  • pressKeyCode,我试了,可以的

  • 没用appium espresso, 用的原生的espresso

  • 今天试着用espresso去写脚本,发现它是基于activity的,就是每个test都会跟一个activity绑定吧,代码如下:
    @Rule
    public ActivityTestRule mLoginActivityTestRule =
    new ActivityTestRule(LoginActivity.class);

    @Test
    public void clickLoginButton_showsSuccessScreenAfterLogin() {
    String email = "username@email.com";
    String password = "password";

    //type in email
    onView(withId(R.id.edit_text_email)).perform(typeText(email), closeSoftKeyboard());

    //type in password
    onView(withId(R.id.edit_text_password)).perform(typeText(password), closeSoftKeyboard());

    //click on login button
    onView(withId(R.id.button_login)).perform(click());

    //verify that success screen shows
    String successString = InstrumentationRegistry.getTargetContext().getString(R.string.text_login_successful);
    onView(withText(successString)).check(matches(isDisplayed()));

    但是我跟Android研发同事聊,他们用了RN框架后就一个MainActivity,这样的话是不是espresso也不能用了

  • 看了下espresso的demo视频,执行速度比appium要快多了。另外,编写获取当前界面信息的工具,目前我还没这个能力,如果不借助工具呢,如何去获取定位信息呢?要去看app的源码吗?google没有提供类似UIautomatorview的工具吗?

  • 我试了下打印pagesource,里面居然出现了resource-id, resource-id="android:id/action_mode_bar_stub",
    resource-id="app:id/action_bar_root" viewIndex="4

  • 今天在GitHub上看到了这个工程appium-espresso-driver,看说明貌似是在appium中使用espresson, 但没有使用例子,我只是简单的添加了参数 cap.setCapability("automationName", "Espresso"); 报这个错误Got an unexpected response: {"id":"26428249-e523-49bd-b144-7bc42d1b3efa","sessionId":null,"status":7,"value":"io.appium.espressoserver.lib.handlers.exceptions.NoSuchElementException: Could not find element with strategy XPATH and selector //android.view.ViewGroup[@index='0']\n\tat io.appium.espressoserver.lib.handlers.FindE..., 这个是不是您说的espresso获取到的控件信息和UIAutomator的不一样了

  • 那看来只能改用espresso了

  • 通过TouchAction 的tap呢?我试了下面的代码
    TouchAction actions =new TouchAction(driver);
    actions.tap(PointOption.point(50,120)).waitAction(WaitOptions.waitOptions(Duration.ofSeconds(1))).perform();
    但是返回[debug] [W3C (cb4356b0)] Responding to client with driver.performTouch() result: null