0

I'm developing an automation for an android mobile app using Appium and Python in emulator. that app have document upload functionality. I'm able to upload the files into the Emulator storage using adb push command but cannot upload the file which is in the android emulator storage to the corresponding android app and for the past few days I have tried several methods but are unable to complete that uploading functionality. Any help or guidance would be appreciated.

The things I have tried:

document = driver.find_element(by=AppiumBy.ID, value="com.indigo.habi:id/button_pick_from_document")
file_path = 'D:/me/projects/src/documents/statement.pdf'

push = driver.push_file('/sdcard/Download/statement.pdf',file_path)

document.send_keys('/sdcard/Download/statement.pdf')

This error shows while using send keys:

Message: Cannot set the element to '/sdcard/Download/bank_statement.pdf'. 
Did you interact with the correct element?
Robert
  • 39,162
  • 17
  • 99
  • 152
Mohanraj M
  • 11
  • 3
  • `but cannot upload the file which is in the android emulator storage to the corresponding android app ` How are you trying that? And what exactly would be the corresponding app? And what do you have in mind if you say 'upload to an app'? I usually upload files to a server .. – blackapps Jun 27 '23 at 10:00
  • there is an upload button in the android app,when i click that button it opens file explorer we have to select the files from that explorer. @blackapps – Mohanraj M Jun 27 '23 at 10:13
  • @blackapps I dont have the URL of that server for file uploading so i need to use that upload button in emulator – Mohanraj M Jun 27 '23 at 10:16
  • You did not answer one of my comments. Come to the point please. – blackapps Jun 27 '23 at 14:42
  • @blackapps `but cannot upload the file which is in the android emulator storage to the corresponding android app` I am trying that using appium python sendkeys() method.. the app was hdfc loanassist – Mohanraj M Jun 28 '23 at 04:44

0 Answers0