I have a simple script which is trying to upload a file directly to my application. This test works fine on my local setup (win10 + chrome 73) however when running through browserstack-local (which as I understand sets up a secure connection to my local machine) I am receiving the following error.
Failed: invalid argument: File not found : C:\correctPath/correctFileName.zip
[Chrome #01] (Session info: chrome=73.0.3683.86)
[Chrome #01] (Driver info: chromedriver=73.0.3683.68 (47787ec04b6e38e22703e856e101e840b65afe72),platform=Windows NT 10.0.15063 x86_64) (WARNING: The server did not provide any stacktrace information)
I am printing out the following confirmations so I know that the paths are correct.
Which produces
[Chrome #01] File Path: C:\correctPath/correctFileName.zip
[Chrome #01] File exists: true
These are printed before the failure occurs.
Note: I can run tests which do not require uploading files fine.
I am brand new to browserstack so there may be something simple I am missing. Any help or advise would be appreicated.
Answer:
Corey pointed me in the right direction with his answer. I needed to add the following two lines to my onPrepare in my config file and I can upload fine now.
const remote = require('selenium-webdriver/remote');
await browser.setFileDetector(new remote.FileDetector());
