Appium Desktop錄製測試用例

Appium Desktop錄製測試用例

Appium Desktop錄製測試用例

Appium Desktop錄製測試用例

Appium Desktop錄製測試用例

錄製的腳本,能夠拷貝到文件,用Pycharm打開
加了一個隱式等待python

This sample code uses the Appium python client

pip install Appium-Python-Client

Then you can paste this into a file and simply run with Python

from appium import webdriverandroid

caps = {}
caps["platformName"] = "android"
caps["deviceName"] = "noblank"
caps["autoGrantPermissions"] = "true"
caps["appActivity"] = ".view.WelcomeActivityAlias"
caps["appPackage"] = "com.xueqiu.android"web

driver = webdriver.Remote("http://localhost:4723/wd/hub", caps)
driver.implicitly_wait(10)app

el1 = driver.find_element_by_id("com.xueqiu.android:id/tv_skip")
el1.click()ide

el2 = driver.find_element_by_xpath("/hierarchy/android.widget.FrameLayout/android.view.ViewGroup/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.LinearLayout[1]/android.widget.LinearLayout/android.widget.TextView")
el2.click()
el3 = driver.find_element_by_xpath("/hierarchy/android.widget.FrameLayout/android.view.ViewGroup/android.widget.FrameLayout[1]/android.view.ViewGroup/android.widget.EditText")
el3.send_keys("alibaba")測試

driver.quit()ui

只要啓動Appium Server, 就能夠運行成功了!this

可使用Appium Desktop運行server,
或者在命令行直接運行appium啓動server命令行

相關文章
相關標籤/搜索