6-3-3ios自动化-数据驱动
Posted singleSpace
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了6-3-3ios自动化-数据驱动相关的知识,希望对你有一定的参考价值。
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表格
以上是关于6-3-3ios自动化-数据驱动的主要内容,如果未能解决你的问题,请参考以下文章
关于mysql驱动版本报错解决,Cause: com.mysql.jdbc.exceptions.jdbc4Unknown system variable ‘query_cache_size(代码片段