I have an App that works just fine with Chrome, and I wanted to move to PhantomJS to make it work faster, since it has to go through many URLs.
const driver = new Builder()
.forBrowser("chrome")
.usingServer("http://localhost:4444/wd/hub")
.build();
This code for creating my driver works just fine for chrome but when I replace chrome with phantomjs I get the following error:
SessionNotCreatedError: Unable to create session from {
"desiredCapabilities": {
"browserName": "phantomjs"
},
"capabilities": {
"firstMatch": [
{
"browserName": "phantomjs"
}
]
}
}
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
System info: host: '', ip: '192.168.56.1', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_301'
Driver info: driver.version: unknown
at Object.checkLegacyResponse (C:\Users\\Desktop\\node_modules\selenium-webdriver\lib\error.js:553:15)
at parseHttpResponse (C:\Users\\Desktop\\node_modules\selenium-webdriver\lib\http.js:635:13)
at Executor.execute (C:\Users\\Desktop\\node_modules\selenium-webdriver\lib\http.js:569:28)
at processTicksAndRejections (node:internal/process/task_queues:94:5) {
remoteStacktrace: ''
}
I have also downloaded and placed the PhantomJS.exe executable in my directory