Selenium WebdriverIO issue when typing numbers
- July 6, 2016
I ran into an issue where my WebdriverIO script would just crash, not leaving any logs, no clues as to why it stopped running.
As I realised it stopped when I called
client.keys(foobar) – and foobar was a variable that was a number that is passed into my Node.js script via yargs (yaaaaaarrrrgggg) – which mind you, is an awesome Node module to use if you like passing in parameters via the CLI.
It turns out that because the type of this variable was a
number – Selenium didn’t like it. I guess the number type could be reserved for the keyboard number codes or something like that?
Anyway, I’ve had to turn it into a
string for it to work properly :
const interval = argv.interval.toString()
Hope this helps someone!