I am automating a Flutter app with Appium Flutter Driver, and I need to interact with elements inside a Bottom Sheet widget.
I’m able to wait for general Flutter widgets using the flutter:waitFor
command with ByValueKey, but I’m unsure how to specifically handle Bottom Sheets.
What I have tried:
- Waiting for the Bottom Sheet container key using:
Map<String, Object> args = new HashMap<>();
args.put("finderType", "ByValueKey");
args.put("keyValueString", "bottom_sheet_container_key");
args.put("keyValueType", "String");
driver.executeScript("flutter:waitFor", args);
- Then trying to locate buttons or input fields inside the Bottom Sheet by their keys or text.
However, I’m not confident this is the best approach, and sometimes elements inside the Bottom Sheet are not detected or are not interactable.
Questions:
- What is the recommended way to wait for and interact with Bottom Sheet elements in a Flutter app using Appium Flutter Driver?
- Should I wait for the Bottom Sheet container first, then locate the children, or is there a better method?
- Are there any special considerations or commands when dealing with Bottom Sheets?
- How can I programmatically dismiss the Bottom Sheet using Appium?
Any sample code snippets or tips on handling Bottom Sheets effectively would be appreciated!
I appreciate any help you can provide.