码迷,mamicode.com
首页 > 编程语言 > 详细

python--编写用例脚本

时间:2016-06-16 18:00:20      阅读:373      评论:0      收藏:0      [点我收藏+]

标签:

from appium import webdriver
import time

desired_caps = {}
desired_caps[‘platformName‘] = ‘Android‘
desired_caps[‘platformVersion‘] = ‘4.4.2‘
desired_caps[‘deviceName‘] = ‘test1‘
desired_caps[‘appPackage‘] = ‘com.xxxxx‘
desired_caps[‘appActivity‘] = ‘.xxxx‘

driver = webdriver.Remote(‘http://localhost/wd/hub‘, desired_caps)

#在输入框中输入值

driver.find_element_by_class_name("xxx.EditText").send_keys("xxx")

#点击事件
driver.find_element_by_id("xxx").click()

# login
driver.find_element_by_id("xxx").click()

#等待2秒

time.sleep(2)


# massage
driver.find_element_by_id("xxx").click()
driver.find_element_by_id("xxx").click()

#退出app
driver.quit()

python--编写用例脚本

标签:

原文地址:http://www.cnblogs.com/susan-su/p/5591647.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!