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

后端 未结 3 1374
南方客
南方客 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:20

    Sorry for misleading !!! In case of testing web apps in browser the elements should be located as usual elements on the web page ( not as some classes like android.widget.EditText and android.widget.Button). So try for example the following and you will see some result:

        var element = _driver
                .findElementByXPath("//input[@id='lst-ib']");
    

    To get locators you should run the browser on your desktop, open the page and use some tools/extensions like Firebug in Firefox or Firebug Lite in Chrome browser.

提交回复
热议问题