提问人:Mohanraj M 提问时间:6/5/2023 最后编辑:Mohanraj M 更新时间:6/29/2023 访问量:84
如何将 Appium-Python 代码从 Sync 转换为 Async
How to convert the Appium-Python code from Sync to Async
问:
from time import sleep
import Asyncio as Asyncio
from appium import webdriver
from appium.webdriver.common.appiumby import AppiumBy
desired_caps = {
"app": "/home/ubuntu/mobile_automation/sample.apk",
"platformName": "Android",
"deviceName": "ubuntu",
"ignoreHiddenApiPolicyError": "true",
# "appium:udid": "emulator-5554",
"unicodeKeyboard": True,
"resetKeyboard": True,
"autoGrantPermissions": True,
"adbExecTimeout": 60000,
"headless":True
}
try:
# Connect to the appium server and open the app
driver = webdriver.Remote('http://127.0.0.1:4723/wd/hub', desired_caps)
driver.implicitly_wait(10)
# Find and click the necessary elements
bank_login_button = driver.find_element(by=AppiumBy.ID, value='com.indigo.sample:id/btn_register_login')
bank_login_button.click()
print("Webdriver Connected")
如何将这个appium python webdiver connection sync convert 成 async in python ?
有什么方法可以转换这个吗?
我需要在 python 中将 sync 转换为 appium webdriver 的异步。 任何帮助都将得到赞赏
答: 暂无答案
评论