I am having an issue with selenium js
I have created my components in json like:
"usernameInputField": {
"selector": {
"xpath": "//*[@id='username']"
}
}
and I am calling webdriver :
var webdriver = require('selenium-webdriver');
using the data like this:
console.log(webdriver.By.xpath("//*[@id='username']"));
it calls correctly
however when I try to run console.log(webdriver.By(usernameInputField.selector));
I get an error (TypeError: Class constructors cannot be invoked without 'new')
what am I doing wrong here?