Search code examples
ui-automationnightwatch.jssaucelabs

Sauce Labs upload files with nightwatch.js


I have tests written with nightwatchJs that are run with remote sauce labs selenium (aka ondemand.saucelabs.com). In the tests flow, I need to upload a local file. When I run tests locally, I use setValue method. But this approach does not seem to be a good one with sauce labs. Is there a proper way to upload local files with nightwatch and sauce labs?


Solution

  • I've came up with this solution: https://github.com/nightwatchjs/nightwatch/issues/890.

    Unfortunately, there is a PR for this feature, but it has not been merged yet. So I forked nightwatch repo and added uploadFileToSeleniumServer method.