1

Previously I used Webdriver IO for testing, but now I use nightwatch.js.

I have not found solutions in documentation (setValue() is not working)

Webdriver IO provides very simple command for that:

.chooseFile("input", "./path/to/image")

But what I can do by using nightwatch.js?

Arsenowitch
  • 381
  • 3
  • 21

1 Answers1

2

The command setValue('input', 'path/to/file') should work, check your file path.

By the way. This question has already been answered previously, check

Community
  • 1
  • 1
Ivan Aranibar
  • 1,996
  • 2
  • 16
  • 20
  • I found the solution by changing css property of input[type=file] from `display: none;` to `visability: hidden;` Now I have the next working code: `.setValue("input.hidden-file", require('path').resolve(__dirname + 'path'))` – Arsenowitch Feb 02 '16 at 09:43