4 execute test scripts appiu

Preface:

    In Appium introduction article, Appium working principle is: Appium-server receives a request json request format corresponding to the operation request by the APP parameter. This article explains the test script to call some of the parameters of Appium-server interface settings

Programming language:

    Python

premise:

    1 Appium environment to build success: Appium environment to build

    2 adb is connected to the real machine / simulator: the adb connected to the phone / simulator

step:

    image.png   

code show as below:   

            from appium import webdriver

            capabilities = \

                {

                    "platformName":"Android",

                    "app": "C:\\Users\\lenovo\\Desktop\\xx.apk",

                    "deviceName":"xxapp",

                    "noReset":"true"

                }

            driver = webdriver.Remote('http://localhost:4723/wd/hub', capabilities)


Alternatively, you can use this tool to establish a direct connection Appium provided, but also the subsequent operation of page elements, build or directly in code.

    image.png

   image.png        





Guess you like

Origin blog.51cto.com/12936780/2461993