Closed LVHAI closed 2 months ago
I try to use send_keys ,also went wrong.
elements = driver.find_elements(by=AppiumBy.CLASSNAME,value='android.widget.EditText') print(elements) for ele in elements: ele.click() print(ele.text) driver.implicitlywait(1) ele.clear() ele_.send_keys('111111')
Traceback (most recent call last):
File "/Users/xxx/work/yfph_loan/./test_driver/apptest.py", line 227, in
The below WebDriver example is by webdriverio. flutter: prefix commands are mobile: command in appium for Android and iOS. Please replace them properly with your client.
https://github.com/appium/appium-flutter-driver?tab=readme-ov-file#commands
It looks like your client is Python, then the command should be driver.execute_script
instead of driver.execute
with webdriverio.
@KazuCocoa TKS your replay。 I use "mobile:enterText", but i get another wrong.
Traceback (most recent call last):
File "/Users/xxx/work/yfph_loan/./test_driver/app_test.py", line 264, in
It should be flutter:
prefix as the command description.
@KazuCocoa tks,it works。
phone_finder = finder.by_value_key('phone_input') phone_ele = FlutterElement(driver,phone_finder) phone_ele.click() driver.execute_script('flutter:enterText','111111')
phone_finder = finder.by_value_key('phone_input1') phone_ele = FlutterElement(driver,phone_finder) phone_ele.click() driver.execute_script('flutter:enterText','222222')
Appium : 2.11.1 Appium-Flutter-Finder ~= 0.7.0 Appium-Python-Client ~= 4.0.0 selenium : 4.22.0
When i run driver,i meet some wrong.
options.automation_name = 'flutter'
options.automation_name = 'UiAutomator2'
options.platform_name = 'Android' options.set_capability('deviceName', 'ALP AL00') options.set_capability('noReset', True) # 是否清空缓存 options.set_capability('fullReset', False) # 是否全部清楚 options.set_capability('resetKeyboard',True) # 隐藏键盘 options.set_capability('unicodeKeyboard',True) # driver = Remote('http://localhost:4723', options=options) driver.switch_to.context('NATIVE_APP')
elements = driver.find_elements(by=AppiumBy.CLASSNAME,value='android.widget.EditText') print(elements) for ele in elements: ele.clear() ele.click() driver.implicitly_wait(1) driver.execute('flutter:enterText', {'text':'111111'})
--------------Traceback---------------------- Traceback (most recent call last): File "/Users/xxx/work/yfph_loan/./test_driver/app_test.py", line 227, in
driver.execute('flutter:enterText', {'text':'111111'})
File "/Users/xxx/Library/Python/3.9/lib/python/site-packages/selenium/webdriver/remote/webdriver.py", line 352, in execute
response = self.command_executor.execute(driver_command, params)
File "/Users/xxx/Library/Python/3.9/lib/python/site-packages/selenium/webdriver/remote/remote_connection.py", line 290, in execute
command_info = self._commands[command]
KeyError: 'flutter:enterText'