摘要: 一、截图方法 1.get_screenshot_as_file(self, filename) --这个方法是获取当前window的截图,出现IOError时候返回False,截图成功返回True。 filename参数是保存文件的路径。Usage:driver.get_screenshot_as_ 阅读全文
posted @ 2019-06-08 22:00 Test挖掘者 阅读(592) 评论(0) 推荐(0) 编辑
摘要: 在线安装:pip install yamlimport yamlimport os# 获取当前脚本所在文件夹路径curpath = os.path.dirname(os.path.realpath(__file__))# 获取yaml文件路径yamlpath = os.path.join(curpa 阅读全文
posted @ 2019-06-08 16:17 Test挖掘者 阅读(612) 评论(0) 推荐(0) 编辑
摘要: from appium import webdriverfrom appium.webdriver.common.touch_action import TouchActionfrom appium.webdriver.common.multi_action import MultiActionfr 阅读全文
posted @ 2019-06-08 16:14 Test挖掘者 阅读(3480) 评论(0) 推荐(1) 编辑
摘要: from appium import webdriverfrom time import sleepdesired_caps = { "platformName":"Android", "platformVersion":"9", "deviceName":"4871660c", "appPacka 阅读全文
posted @ 2019-06-08 16:14 Test挖掘者 阅读(575) 评论(0) 推荐(0) 编辑
摘要: 方法一: 阅读全文
posted @ 2019-06-08 16:11 Test挖掘者 阅读(2393) 评论(0) 推荐(0) 编辑
摘要: import osimport time as tdef start_appium(port = 4723,udid="4871660c"): a = os.popen("netstat -ano | findstr '%s'"%port) t.sleep(2) t1 = a.read() prin 阅读全文
posted @ 2019-06-08 16:10 Test挖掘者 阅读(525) 评论(0) 推荐(0) 编辑
摘要: import osfrom appium import webdriver# 安装app,为了方便,把app放到当前脚本同一目录os.system("adb install sina.apk")#获取项目的根目录路径path_file = os.path.abspath(os.path.join(o 阅读全文
posted @ 2019-06-08 16:09 Test挖掘者 阅读(276) 评论(0) 推荐(0) 编辑
摘要: from appium import webdriverfrom appium.webdriver.common.touch_action import TouchActionfrom time import sleepdesired_caps = { 'platformName': 'Androi 阅读全文
posted @ 2019-06-08 16:07 Test挖掘者 阅读(668) 评论(0) 推荐(0) 编辑
摘要: from appium.webdriver.common.touch_action import TouchActionfrom appium import webdriverimport timeimport osdesired_caps = { "platformName":"Android", 阅读全文
posted @ 2019-06-08 16:06 Test挖掘者 阅读(630) 评论(0) 推荐(0) 编辑
摘要: import osimport time as tadb = 'adb shell input tap 400 500'os.system(adb)t.sleep(5)class keyevent(): """常用的keyevent事件""" KEYCODE_HOME = 3 #home键 KEYC 阅读全文
posted @ 2019-06-08 16:05 Test挖掘者 阅读(583) 评论(0) 推荐(0) 编辑
摘要: from appium import webdriverfrom selenium.webdriver.support.wait import WebDriverWaitfrom selenium.webdriver.support import expected_conditions as ECf 阅读全文
posted @ 2019-06-08 16:04 Test挖掘者 阅读(973) 评论(0) 推荐(0) 编辑
摘要: # coding:utf-8"""参考博客链接:https://www.cnblogs.com/yoyoketang/p/7843819.html"""from appium import webdriverfrom selenium.webdriver.support.ui import WebD 阅读全文
posted @ 2019-06-08 16:02 Test挖掘者 阅读(241) 评论(0) 推荐(0) 编辑
摘要: # coding:utf-8from appium import webdriverfrom time import sleepdesired_caps = { 'platformName': 'Android', 'deviceName': '127.0.0.1:62001', 'platform 阅读全文
posted @ 2019-06-08 16:01 Test挖掘者 阅读(326) 评论(0) 推荐(0) 编辑
摘要: from appium import webdriverfrom selenium.webdriver.support.ui import WebDriverWaitfrom selenium.webdriver.support import expected_conditions as ECimp 阅读全文
posted @ 2019-06-08 15:59 Test挖掘者 阅读(341) 评论(0) 推荐(0) 编辑
摘要: from selenium import webdriverfrom selenium.webdriver.support.wait import WebDriverWaitfrom selenium.webdriver.support import expected_conditions as E 阅读全文
posted @ 2019-06-08 14:38 Test挖掘者 阅读(759) 评论(0) 推荐(0) 编辑
摘要: from selenium import webdriverfrom selenium.webdriver.support.wait import WebDriverWaitimport timedriver = webdriver.Chrome()# 启动浏览器后获取cookiesprint(dr 阅读全文
posted @ 2019-06-08 14:36 Test挖掘者 阅读(264) 评论(0) 推荐(0) 编辑
摘要: title_is: 判断当前页面的title是否完全等于(==)预期字符串,返回布尔值title_contains : 判断当前页面的title是否包含预期字符串,返回布尔值presence_of_element_located : 判断某个元素是否被加到了dom树里,并不代表该元素一定可见visi 阅读全文
posted @ 2019-06-08 14:33 Test挖掘者 阅读(436) 评论(0) 推荐(0) 编辑