AppiumDesktop录制测试用例-创新互联

Appium Desktop录制测试用例

创新互联主营岚山网站建设的网络公司,主营网站建设方案,重庆APP软件开发,岚山h5小程序开发搭建,岚山网站营销推广欢迎岚山等地区企业咨询

Appium Desktop录制测试用例

Appium Desktop录制测试用例

Appium Desktop录制测试用例

录制的脚本,可以拷贝到文件,用Pycharm打开
加了一个隐式等待

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 webdriver

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

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

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

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()

只要启动Appium Server, 就可以运行成功了!

可以使用Appium Desktop运行server,
或者在命令行直接运行appium启动server


当前名称:AppiumDesktop录制测试用例-创新互联
文章源于:http://pwwzsj.com/article/cdoeio.html