https://testerhome.com/topics/14247

#!/usr/bin/env python3
# coding:utf-8
from appium import webdriver
import time,selenium,openpyxl,unittest class testCheat(unittest.TestCase):
def setUp(self):
self.wb=openpyxl.load_workbook("ms.xlsx",data_only=True)
self.wb.guess_types=True
self.sh=self.wb['工作表 1']
self.caps={}
self.caps['bundleId']='com.taobaobj.moneyshield'
self.caps['newCommandTimeout']=600
self.driver=webdriver.Remote("http://192.168.43.86:8100/wd/hub",self.caps)
time.sleep(5) def find_element(self,xpath,timeout=30):
deadline=time.time()+timeout
while time.time() < deadline:
try:
el=self.driver.find_element_by_xpath(xpath)
return el
except Exception as e:
time.sleep(0.5)
raise RuntimeError("Element not found ") def test_ch(self):
for row in self.sh.rows:
if row[3].value not in ['yes',]:
continue
print(row[0].value,row[1].value)
op=row[0].value
xpath=row[1].value
if op =='click':
self.find_element(xpath).click()
if op == 'assert':
self.find_element(xpath)
if op=='send_keys':
self.find_element(xpath).send_keys(row[4].value) def tearDown(self):
self.driver.quit() if __name__=='__main__':
unittest.main()

excel表格



最新文章

  1. java中判断字符串是否为只包含数字
  2. [译]Godot系列教程一 - 场景与节点
  3. 推荐一个iOS关于颜色的库-Wonderful
  4. uboot补丁的分析
  5. CF453B Little Pony and Harmony Chest (状压DP)
  6. 未能找到类型或命名空间名称“Coco”(是否缺少 using 指令或程序集引用)
  7. mysql中的unique
  8. sql server Convert 的函数的用法 转换成浮点数
  9. pip安装lxml报错
  10. PHP 导入excel
  11. 纯C语言INI文件解析
  12. clip实现圆环进度条
  13. for /r命令实现全盘搜索指定文件
  14. kafka知识体系-kafka设计和原理分析-kafka文件存储机制
  15. iOS键盘事件实现、控制
  16. 数据库索引的数据结构b+树
  17. Python 3 iter函数用法简述
  18. 10个提升MySQL性能的小技巧
  19. 机器学习使用sklearn进行模型训练、预测和评价
  20. LeetCode 349 Intersection of Two Arrays 解题报告

热门文章

  1. Sqoop2安装
  2. ES Log4J配置信息
  3. centos7下Redis-Sentinel安装和配置
  4. Tomcat学习之二:tomcat安装、配置及目录文件说明
  5. 用于主题检测的临时日志(0ece3f5c-d74f-449c-85a7-ed53fffb0e94 - 3bfe001a-32de-4114-a6b4-4005b770f6d7)
  6. Ubuntu忘记root密码的解决方法
  7. URAL - 1397:Points Game (博弈,贪心)
  8. kafka日志同步至elasticsearch和kibana展示
  9. 【C#】 增加多个分部类
  10. 【java规则引擎】《Drools7.0.0.Final规则引擎教程》第4章 4.2 agenda-group