This site is in read only mode. Please continue to browse, but replying, likes, and other actions are disabled for now.
1 / 8
Oct 2015

Currently i use Appium and Selenium-Webdriver to run Automation Web Application on real iOS/Android device. I would like to know if there is a way where we can Upload file using SendKeys of Selenium-Webdriver ?

My test-running-machine is Win 7 64 bit

I have tried both using the path of file from the test-running-machine (e.g C:\file.jpg) and using path of file that on the device(Android/iOS) ( e.g /sdcard/Download/myfile.png).

Using file path from the test-running-machine it would upload a null file to the web-driver no excetpion

Using file path from the device itself web-driver will throw exception: "org.openqa.selenium.WebDriverException: unknown error: path is not absolute: /sdcard/Download/myfile.png"

Any help would be very much appreciated.

  • created

    Oct '15
  • last reply

    Jan '19
  • 7

    replies

  • 3.5k

    views

  • 4

    users

Ideally when script is running into device then path should be of a resource inside device

did u checked with adb commands if path u r using is correct

adb shell
cd /sdcard/Download
ls - if this displays myfine.png

@amitjaincoer191 Thanks for responding. I did run the command above to make sure the file is existed. Here is the output:

adb shell
shell@ASUS_T00F:/ $ cd sdcard/Download/
shell@ASUS_T00F:/sdcard/Download $ ls
myfile.png

try like this

sdcard/Download/myfine.png
/sdcard/Download/myfine.png
sdcard\Download\myfine.png
\sdcard\Download\myfine.png

@amitjaincoer191 Still no luck.

Exception: "org.openqa.selenium.WebDriverException: unknown error: path is not absolute: path\path " still appear

Thanks for helping.

1 year later

HI, Any solution ? were you able to upload file using appium driver?

1 year later