Unable to find an element in Browser of the Android emulator using Appium and C#

后端 未结 3 1360
南方客
南方客 2021-01-26 12:37

I want to automate mobile web site testing on Android emulator using c# and Appium. There is a simple test scenario I want to automate for the start:
1. Start Browser
2.

3条回答
  •  日久生厌
    2021-01-26 13:03

    Update ! The following approach is not for web testing:

    Could you try to find the element using xpath?

    @FindBy(xpath="//android.widget.EditText[contains(@resource-id, 'url')]")
    

    So in your case you can try the following:

    var element = _driver.findElementByXPath("//android.widget.EditText[contains(@resource-id, 'url')]");
    

    Update: in case of testing web apps (not native) you should use web page locators instead of Android classes.

提交回复
热议问题