Appium学习
from appium import webdriver import unittest import time class QQlogin(unittest.TestCase): def setUp(self): desired_caps = {‘platformName‘: ‘Android‘, # 平台名称 ‘platformVersion‘: ‘5.1.1‘, # 系统版本号 ‘deviceName‘: ‘127.0.0.1:62001‘, # 设备名称。如果是真机,在‘设置->关于手机->设备名称‘里查看 ‘appPackage‘: ‘com.tencent.mobileqq‘, # apk的包名 ‘appActivity‘: ‘com.tencent.mobileqq.activity.LoginActivity‘ # activity 名称 } self.driver = webdriver.Remote("http://127.0.0.1:4723/wd/hub", desired_caps) # 连接Appium self.driver.implicitly_wait(15) time.sleep(15) def test_login(self): el1 = self.driver.find_element_by_id("com.tencent.mobileqq:id/btn_login") el1.click() el2 = self.driver.find_element_by_accessibility_id("请输入QQ号码或手机或邮箱") el2.send_keys("xxxxxx") el3 = self.driver.find_element_by_accessibility_id("密码 安全") el3.send_keys("xxxxxx") el4 = self.driver.find_element_by_accessibility_id("登 录") el4.click() def tearDown(self): self.driver.quit() if __name__ == ‘__main__‘: unittest.main()
QQ登录
相关推荐
deadgrape 2020-03-06
歆萌 2020-08-03
xjp 2020-08-03
lucialee 2020-07-18
歆萌 2020-07-05
maowenbei 2020-07-04
QCkiss 2020-06-21
无缘公子 2020-06-18
xhpscdx 2020-06-16
freerocker 2020-06-16
ZoctopusD 2020-06-14
lucialee 2020-06-13
xhpscdx 2020-06-12
RocketJ 2020-06-11
chichichi0 2020-06-10
Dipa 2020-06-09
dangai00 2020-06-06