While developing tests using Webdriver.io, a JavaScript API for Selenium WebDriver, everything was running smoothly until I encountered an error while trying to run the $ wdio wdio.conf.js
command. The error message displayed as follows:
>ERROR: Unexpected identifier
firefox
Syntax at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:374:25)
at Object.Module._extensions..js (module.js:417:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Module.require (module.js:354:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (/home/joe/Desktop/Webtesting/test/test.js:10:17)
at Module._compile (module.js:410:26)
at Object.Module._extensions..js (module.js:417:10)
The issue doesn't seem to lie within my code as even after reverting back to a previous commit, the same error persisted. It appears to be related to the wdio.conf.js file, particularly in this line. Surprisingly, changing the browser name to 'chrome' did not resolve the error:
capabilities: [{
maxInstances: 5,
browserName: 'firefox'
}],