How to Automate File Upload in React Native App Using Appium Without Native File Picker

Hello community,

I’m currently working on automating end-to-end tests for a React Native application using Appium, and I’m looking for a way to handle file uploads without interacting with the native Android file picker UI.

My goal is to:

  1. Push a file to the Android device using Appium’s pushFile.

  2. Use that file for upload within the app programmatically, bypassing the native picker.

Specifically, I’m trying to understand:

  • Is there a way to directly set the file path for a React Native file upload component (similar to using sendKeys on <input type="file"> in web automation)?

  • Are there alternative approaches or best practices to provide the file programmatically to the application during testing?

Any guidance, sample implementations, or recommended strategies for React Native apps would be greatly appreciated.

Thank you in advance for your help!