Hi All,
I am trying to connect to my set top box via chromedriver.exe (chromedriver=72.0.3626.69) from my laptop but I am unable to do so. My set top box has chromium and webdriver enabled. We used to run test scripts via selenium python/selenium java remote web driver libraries on the set-top box (headless chrome) - the channel surfing, the opening of tv guide, etc can be easily seen on the TV. The precondition is set-top should be webdriver enabled with the ethernet cable connected so that it gets IP address.
Currently we want to replicate the same structure via codeceptjs / webdriver libraries. Following is the configuration which I have tried :
- codecept.conf.js file
exports.config = {
tests: ‘./*_test.js’,
output: ‘./output’,
helpers: {
WebDriver: {
url: 'http://locahost',
port: 9515,
smartWait: 30000,
waitForTimeout: 15000,
keepBrowserState: true,
restart: false,
browser: 'chrome',
desiredCapabilities:{
chromeOptions: {
args : ["--disable-gpu","--allow-file-access-from-files", "--disable-web-security", "--ignore-certificate-errors" ],
debuggerAddress: "10.12.130.83:2999", /* this is the ip address of set top box */
},
}
},
MyHelper:{
require: "./codecept_anupam.js"
}
}
}
- codecept_anupam.js
const Helper = codecept_helper;
const event = require(‘codeceptjs’).event;
class MyHelper extends Helper {
constructor () {
super();
}
_beforeSuite (suite) {
console.log(’_beforeSuite’);
this.suiteTitle = suite.title;
console.log(this.helpers);
console.log(this.helpers[‘WebDriver’]);
if (!this.target)
{
//this.target = this.helpers[‘Puppeteer’];
this.target = this.helpers[‘WebDriver’];
this.page = this.target.browser;
//this.page.send(‘Security.setIgnoreCertificateErrors’, { ignore: true });
}
//return this.target.amOnPage(‘file:///C:/development/Codefest/app/client/launch-emulator.html’);
}
}
module.exports = MyHelper;
;
I have made sure Selenium server is up and running with chromedriver . I have used the following command.
java -Dwebdriver.chrome.driver=chromedriver.exe -jar selenium-server-standalone-3.141.59.jar -port 9515
The following is the error message:-
» [Session] Starting singleton browser session
[1] Error | Error: Can’t connect to WebDriver.
session not created: session not created
from unknown error: unhandled inspector error: {“code”:-32601,“data”:[{“code”:-32601,“message”:"‘Target’ domain was not found"}],“message”:"‘Target’ domain was not found"}
(Session info: =)
(Driver info: chromedriver=72.0.3626.69 (3c16f8a135abc0d4da2dff33804db79b849a7c38),platform=Windows NT 10.0.14393 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 115 milliseconds
Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:25:53’
System info: host: ‘MOB700042’, ip: ‘169.254.47.0’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘1.8.0_101’
Driver info: driver.version: unknown
Please make sure Selenium Server (ChromeDriver or PhantomJS) is running and accessible
Emitted | test.failed ([object Object])
× “before all” hook: codeceptjs.beforeSuite in 2079ms
[1] Error | Error: Can’t connect to WebDriver.
session not created: session not created
from unknown error: unhandled inspector error: {“code”:-32601,“data”:[{“code”:-32601,“message”:"‘Target’ domain was not found"}],“message”:"‘Target’ domain was not found"}
(Session info: =)
(Driver info: chromedriver=72.0.3626.69 (3c16f8a135abc0d4da2dff33804db79b849a7c38),platform=Windows NT 10.0.14393 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 115 milliseconds
Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:25:53’
System info: host: ‘MOB700042’, ip: ‘169.254.47.0’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘1.8.0_101’
Driver info: driver.version: unknown
Please make sure Selenium Server (ChromeDriver or PhantomJS) is running and accessible
Error: Can’t connect to WebDriver.
session not created: session not created
from unknown error: unhandled inspector error: {“code”:-32601,“data”:[{“code”:-32601,“message”:"‘Target’ domain was not found"}],“message”:"‘Target’ domain was not found"}
(Session info: =)
(Driver info: chromedriver=72.0.3626.69 (3c16f8a135abc0d4da2dff33804db79b849a7c38),platform=Windows NT 10.0.14393 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 115 milliseconds
Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:25:53’
System info: host: ‘MOB700042’, ip: ‘169.254.47.0’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘1.8.0_101’
Driver info: driver.version: unknown
Please make sure Selenium Server (ChromeDriver or PhantomJS) is running and accessible
Kindly help !!