【问题标题】:app.EnterText() doesn`t enter text to entry in Android 7 and higher in XamarinUiTestapp.EnterText() 不会在 XamarinUiTest 中输入要在 Android 7 及更高版本中输入的文本
【发布时间】:2017-12-07 11:32:36
【问题描述】:

我成功地运行了测试:

  • 物理 Android 5.1;
  • Android 6.0.1 模拟器;
  • testCloud 设备 5.1、5.1.1、6.0.1

但是当我尝试在 Android 模拟器 7.0 和 Android 设备 7 及更高版本的 testCloud 上运行我的 UITest 时,它会忽略 app.EnterText() method 它进入用户名条目,然后它必须在其中输入文本,但它不这样做并且在没有任何文本输入的情况下进入密码条目。如何在 Android 7 中解决这个问题?

[Test]
public void Android_7()
{
    app.WaitForElement(c => c.Marked("UsernameId"));
    app.Tap(c => c.Marked("UsernameId"));
    app.EnterText(c => c.Marked("UsernameId"), "www");
    app.Tap(c => c.Marked("PasswordId"));
    app.EnterText(c => c.Marked("PasswordId"), "testpsswd");
    app.Screenshot("Logining");
    app.Tap(c => c.Marked("SIGN IN"));
    app.WaitForElement(c => c.Marked("Exigo"));
    app.Screenshot("Dashboard");
}

【问题讨论】:

    标签: android xamarin.android uitest xamarin-test-cloud


    【解决方案1】:

    试试这个: app.Tap (c => c.Marked ("UsernameId")); app.EnterText("www");

    最好不要指定输入文本的 EnterText 字段,有时它是错误的并且没有调用

    【讨论】:

    • 我试过这种方式,但它并没有帮助我弄清楚
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-01-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多