How to get a list of elements in Mobile Appium?

Hi all,

I’m new here and trying to test the application using Appium, webdriverIO, and Cucumber.

I’m stuck in one of the use cases where I have to click on the external device storage folder. And, to click on that folder, first I need to fetch the dir_list where all the folders are listed and I want to click on the intended folder.
To achieve this I have to make the function dynamic in order to click on any folder basis on the Team’s requirement.

For your reference, I have added a picture for you for better understanding. See below for a picture:

Now, the question is how can I get these folders in a list so that it can be iterable to click on the specific folders as per the team’s requirement?

Is there any way to achieve this?

PS: I am using Appium, wdio/cli, webdriverIO, cucumber using NodeJS environment.

Thanks in advance! :slightly_smiling_face:

any update on this? We are using it to test a Flutter app and having similar issue…

Can you show what you have tried so far, what client are you using?
With no information whatsoever, in pseudocode I’d simply do something like:
Driver.FindElement(By.XPath("//*[@text=“YOUR_FOLDER_NAME”]")).Click()

I don’t understand why you’d want them all in a list; What I do above is say “Find me the element which has it’s text equal to “YOUR_FOLDER_NAME” and click on it”.