2)读取配置信息,这里直接贴完整代码了。
def test_run(url, desired):
driver_02 = webdriver.Remote(command_executor=url, desired_capabilities=desired)
driver(driver_02)
def driver(drivers): # 元素操作方法
time.sleep(5)
drivers.quit()
if __name__ == '__main__':
with open("./appium.json", mode="r", encoding="utf-8") as f:
data = list(json.load(f))
for i in range(0, len(data)):
a = threading.Thread(target=test_run, args=(data["url"], data["desired"]))
a.start()