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
464 stars 184 forks source link

Cannot scroll up or down list and not find item by xpath in list on modal flutter #655

Open apatheticL opened 9 months ago

apatheticL commented 9 months ago

My problem is

  1. Case1: don't see view scroll when run command command flutter:scrollIntoView. I has modal contain list country and i want scroll up and select item into list country. but i try execute scrollView but it not work

this is my code

        element_end = self.finder.by_text('VietNam')
        self.driver.execute_script('flutter:scrollIntoView',  element_end, {'alignment': 0.5})
        element_button = FlutterElement(self.driver, element_end);
        element_button.click()

this is my view image this is my error in appium server https://gist.github.com/apatheticL/b7411163509e960cdae255c81f8f44f2

  1. Case 2:

i try with code :

self.driver.switch_to.context('NATIVE_APP') element_end = self.driver.find_element(AppiumBy.XPATH, '//android.view.View[@content-desc="VN VietNam +84"]')

but it not work and log error
['NoSuchElementError: An element could not be located on the page using the given search parameters.', ' at AndroidUiautomator2Driver.findElOrEls (C:\\Users\\tinhn\\.appium\\node_modules\\appium-flutter-driver\\node_modules\\appium-uiautomator2-driver\\node_modules\\appium-android-driver\\lib\\commands\\find.ts:87:11)', ' at runMicrotasks (<anonymous>)', ' at processTicksAndRejections (node:internal/process/task_queues:96:5)', ' at AndroidUiautomator2Driver.findElOrElsWithProcessing (C:\\Users\\tinhn\\AppData\\Roaming\\nvm\\v16.20.0\\node_modules\\appium\\node_modules\\@appium\\base-driver\\lib\\basedriver\\commands\\find.ts:60:12)', ' at AndroidUiautomator2Driver.findElement (C:\\Users\\tinhn\\AppData\\Roaming\\nvm\\v16.20.0\\node_modules\\appium\\node_modules\\@appium\\base-driver\\lib\\basedriver\\commands\\find.ts:75:12)']

okaruk commented 9 months ago

@apatheticL flutter:scrollUntilVisible command scrolls up/down dropdown options list.