Setting custom capabilities for matching specific Nodes

Open
#135 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
docker, javascript, node.js

Research direction

No repository files or tests are named. Start by comparing the linked Selenium Grid custom-capability documentation with the Docker node command and the Node.js selenium-webdriver capability setup; done means identifying whether the reported session-start failure is caused by this configuration and documenting a reproducible resolution.

Written by the indexing model from the issue text.

Description

So I am try to set up custom capabilities for matching specific nodes but I keep getting this error:

Driver initiation:  SessionNotCreatedError: Could not start a new session. Could not start a new session. Error while creating session with the driver service. Stopping driver service: Could not start a new session. Response code 500. Message: session not created: Chrome failed to start: exited normally.
  (session not created: DevToolsActivePort file doesn't exist)
  (The process started from chrome location /opt/google/chrome/chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.) 
Host info: host: 'd86e3f5d6ac3', ip: '172.17.0.2'
Build info: version: '4.23.0', revision: '77010cd'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '5.4.0-122-generic', java.version: '17.0.11'
Driver info: driver.version: unknown
Build info: version: '4.23.0', revision: '77010cd'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '5.4.0-122-generic', java.version: '17.0.11'
Driver info: driver.version: unknown
Build info: version: '4.23.0', revision: '77010cd'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.8.0-36-generic', java.version: '17.0.11'
Driver info: driver.version: unknown
    at Object.throwDecodedError (/home/omoalfa/Desktop/Omoalfa/Node/cloud-runner/node_modules/selenium-webdriver/lib/error.js:521:15)
    at parseHttpResponse (/home/omoalfa/Desktop/Omoalfa/Node/cloud-runner/node_modules/selenium-webdriver/lib/http.js:510:13)
    at Executor.execute (/home/omoalfa/Desktop/Omoalfa/Node/cloud-runner/node_modules/selenium-webdriver/lib/http.js:443:28)
    at processTicksAndRejections (node:internal/process/task_queues:95:5) {
  remoteStacktrace: ''
}

I am following the instructions here
this is how I initiated the browser node using docker:
docker run -d -p 5555:5555 -e SE_EVENT_BUS_HOST=<hub_server_ip> -e SE_EVENT_BUS_PUBLISH_PORT=4442 -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 -e SE_NODE_HOST=<node_server_ip> -e SE_NODE_STEREOTYPE='{ "browserName":"chrome","browserVersion":"120.0","platformName": "linux", "app:project_id": "9a920fb9-cebe-4ef7-8e2d-9b6fbd78f2cd" }' selenium/node-chrome:120.0

and then tried creating a session in my code using the following step:

const options = new chrome.Options();
        
                options.addArguments('--start-maximized');

                options.addArguments('--ignore-certificate-errors');
                
                options.excludeSwitches('enable-logging');
                options.setLoggingPrefs({ browser: 'ALL' });
                options.setBrowserVersion("120.0")
                options.setPlatform("linux")

                capabilities = Capabilities.chrome();
                capabilities.set("se:name", name);
                capabilities.set("app:project_id", "9a920fb9-cebe-4ef7-8e2d-9b6fbd78f2cd")
                capabilities.setAcceptInsecureCerts(true);

                driver = await new Builder().forBrowser(Browser.CHROME).setChromeOptions(options).withCapabilities(capabilities).usingServer(hubServer).build();

Is there a bug somewhere or is there something I am doing wrong?

Dominant language
PHP
Stars
39
Forks
23
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Codeception/module-webdriver

All issues in Codeception/module-webdriver

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.