appium / appium-flutter-driver

Appium Flutter Driver is a test automation tool for Flutter apps on multiple platforms/OSes. Appium Flutter Driver is part of the Appium mobile test automation tool maintained by community
MIT License
442 stars 179 forks source link

How to get multiple TextField at once throw appium-flutterdriver. #714

Closed LVHAI closed 2 weeks ago

LVHAI commented 3 weeks ago

I have mutiple TextFields on a page. And I want to get all the TextFields at once. But when I use FlutterElement, I get an error.

Appium : 2.11.1 Appium-Flutter-Finder ~= 0.7.0 Appium-Python-Client ~= 4.0.0 selenium : 4.22.0

text_finder = finder.by_type('TextField') text_ele = FlutterElement(driver,text_finder) text_ele.find_elements(AppiumBy.ID,text_ele)

Traceback (most recent call last): File "/Users/xxxx/work/yfph_loan/./test_driver/app_test.py", line 251, in text_ele.find_elements(AppiumBy.ID,text_ele) File "/Users/lvsh/Library/Python/3.9/lib/python/site-packages/appium/webdriver/webelement.py", line 144, in find_elements return self._execute(RemoteCommand.FIND_CHILD_ELEMENTS, {'using': by, 'value': value})['value'] File "/Users/xxxx/Library/Python/3.9/lib/python/site-packages/selenium/webdriver/remote/webelement.py", line 395, in _execute return self._parent.execute(command, params) File "/Users/xxxx/Library/Python/3.9/lib/python/site-packages/selenium/webdriver/remote/webdriver.py", line 354, in execute self.error_handler.check_response(response) File "/Users/xxxx/Library/Python/3.9/lib/python/site-packages/appium/webdriver/errorhandler.py", line 125, in check_response raise exception_class(msg=message, stacktrace=format_stacktrace(stacktrace)) selenium.common.exceptions.InvalidSelectorException: Message: Locator Strategy 'id' is not supported for this session; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#invalid-selector-exception

KazuCocoa commented 2 weeks ago

It is not possible right now as no such a method in https://api.flutter.dev/flutter/flutter_driver/flutter_driver-library.html Current possible commands for flutter context is do an action for an element as Finders and Commands in https://github.com/appium/appium-flutter-driver?tab=readme-ov-file#finders https://github.com/appium/appium-flutter-driver?tab=readme-ov-file#commands

https://github.com/appium/appium-flutter-driver/issues/322