I am testing an AngularJS project with a protractor. I have image file download tests that work and transfer correctly on my local Mac. However, when I run the same test through saucelabs, the test fails.
Saucelabs has trouble finding a file and just opens a dialog box, but the file cannot be found. The file is in my test solution, not saucelabs. I was browsing the Internet for answers, but I did not see a definitive answer to this problem. Below is an example of the code that I use to download an image file using an application.
var path = require('path'); it('should upload a file', function() { var fileToUpload = '../some/path/foo.txt', absolutePath = path.resolve(__dirname, fileToUpload); $('input[type="file"]').sendKeys(absolutePath); $('#uploadButton').click(); });
Any help or suggestions on how to get the above code to work through Saucelabs will be appreciated.
source share