以下是使用React Native Appium驱动的示例代码:
from appium import webdriver from appium.webdriver.common.touch_action import TouchAction
caps = {'platformName': 'Android', 'deviceName': 'Android Emulator', 'app': 'path/to/app.apk', 'appPackage': 'com.example.myapp', 'appActivity': 'MainActivity'}
driver = webdriver.Remote('http://localhost:4723/wd/hub', caps)
driver.update_settings({"reactNative": True})
driver.find_element_by_accessibility_id("login").click() driver.find_element_by_id("username").send_keys("myusername") driver.find_element_by_id("password").send_keys("mypassword") driver.find_element_by_accessibility_id("submit").click()
driver.quit()