Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

session not created exception for chrome in Protractor

I get below error when try to run Protractor test against chrome.

My conf.ts

import {Config} from 'protractor'

export let config: Config = {
    framework: 'jasmine',
    // capabilities: { browserName: 'chrome'},
    multiCapabilities: [
        // {browserName: 'firefox'},
        {
            browserName: 'chrome',
            chromeOptions: {
                args: ['--start-maximized']
            },

        }],

    seleniumAddress: 'http://127.0.0.1:4444/wd/hub',
    seleniumPort: null,
    seleniumArgs: [],
    specs: [
        './Protractor/Login/*.spec.js',

Error:

Protractor conf.js
[17:19:07] I/hosted - Using the selenium server at http://127.0.0.1:4444/wd/hub
[17:19:07] I/launcher - Running 1 instances of WebDriver
[17:19:09] E/launcher - session not created exception
from unknown error: Runtime.executionContextCreated has invalid 'context': {"auxData":{"frameId":"8800.1","isDefault":true},"id":1,"name":"","origin":"://"}
  (Session info: chrome=54.0.2840.59)
  (Driver info: chromedriver=2.22.397933 (1cab651507b88dec79b2b2a22d1943c01833cc1b),platform=Windows NT 6.3.9600 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 1.07 seconds
Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:37:03'
System info: host: 'MAL000009416062', ip: '192.168.1.4', os.name: 'Windows 8.1', os.arch: 'amd64', os.version: '6.3', java.version: '1.8.0_73'
Driver info: org.openqa.selenium.chrome.ChromeDriver
[17:19:09] E/launcher - SessionNotCreatedError: session not created exception
from unknown error: Runtime.executionContextCreated has invalid 'context': {"auxData":{"frameId":"8800.1","isDefault":true},"id":1,"name":"","origin":"://"}
  (Session info: chrome=54.0.2840.59)
  (Driver info: chromedriver=2.22.397933 (1cab651507b88dec79b2b2a22d1943c01833cc1b),platform=Windows NT 6.3.9600 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 1.07 seconds
Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:37:03'
System info: host: 'MAL000009416062', ip: '192.168.1.4', os.name: 'Windows 8.1', os.arch: 'amd64', os.version: '6.3', java.version: '1.8.0_73'
Driver info: org.openqa.selenium.chrome.ChromeDriver
    at WebDriverError (C:\Users\392811\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\error.js:27:5)
    at SessionNotCreatedError (C:\Users\392811\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\error.js:308:5)

conf.ts

multiCapabilities: [

        {
            browserName: 'chrome',
            chromeOptions: {
                args: ['--start-maximized']
            },

        }],

Most of the discussion on the web is around version. I am currently using up-to-date versions

Any clue please?

Cheers

like image 800
SMPH Avatar asked Oct 18 '16 06:10

SMPH


People also ask

How do I update Chrome Webdriver in protractor?

Now go to usr/bin, navigate to your webdriver-manager file and delete it. Run sudo npm install -g protractor, and then start your webdriver server, last step do "sudo webdriver-manager update". Now you should be able to invoke your browser :) Show activity on this post.

What is the correct syntax for instantiate a Chrome session?

chrome. driver","D:\\ChromeDriver\\chromedriver.exe"); // Instantiate a ChromeDriver class.


2 Answers

  1. Just run the following command:
  2. Projectdirectory:/>webdriver-manager update --versions.chrome=ChromeVersion
  3. Replace this with "ChromeVersion" Google Chrome Browser Version.Find chrome version by navigating to "Help>>About Google chrome>>For Example: Version 76.0.3809.100 (Official Build) (64-bit)".

I hope this will work for you.

like image 159
Raj Kumar Avatar answered Oct 03 '22 09:10

Raj Kumar


I just needed to:

npm update -g protractor
webdriver-manager update

And it worked again.

like image 21
Marc Stober Avatar answered Oct 03 '22 07:10

Marc Stober