1

I am getting issue while running protractor scripts in eclipse, my spec.js file includes:

describe('angularjs homepage todo list', function() {
  it('should add a todo', function() {

    browser.get('https://angularjs.org');

    element(by.model('todoList.todoText')).sendKeys('write first protractor test');
    element(by.css('[value="add"]')).click();

    var todoList = element.all(by.repeater('todo in todoList.todos'));
    expect(todoList.count()).toEqual(3);
    expect(todoList.get(2).getText()).toEqual('write first protractor test');

    // You wrote your first test, cross it off the list
    todoList.get(2).element(by.css('input')).click();
    var completedAmount = element.all(by.css('.done-true'));
    expect(completedAmount.count()).toEqual(2);
  });
});

and conf.js file includes:

// conf.js
exports.config = {
  framework: 'jasmine',
  seleniumAddress: 'http://localhost:4444/wd/hub',
  specs: ['spec.js']
}

when I run the conf.js file, chrome browser is opened successfully but after some wait, below error is displayed on console:

 [12:15:58] I/launcher - Running 1 instances of WebDriver
    [12:15:58] I/hosted - Using the selenium server at http://localhost:4444/wd/hub
    [12:16:59] E/launcher - unknown error: Devtools port number file contents <50477> were in an unexpected format
      (Driver info: chromedriver=2.40.565498 (ea082db3280dd6843ebfb08a625e3eb905c4f5ab),platform=Windows NT 6.1.7601 SP1 x86_64) (WARNING: The server did not provide any stacktrace information)
    Command duration or timeout: 60.17 seconds
    Build info: version: '3.12.0', revision: '7c6e0b3', time: '2018-05-08T15:15:08.936Z'
    System info: host: 'HKAUR7-QA', ip: '10.8.11.172', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_92'
    Driver info: driver.version: unknown
    [12:16:59] E/launcher - WebDriverError: unknown error: Devtools port number file contents <50477> were in an unexpected format
      (Driver info: chromedriver=2.40.565498 (ea082db3280dd6843ebfb08a625e3eb905c4f5ab),platform=Windows NT 6.1.7601 SP1 x86_64) (WARNING: The server did not provide any stacktrace information)
    Command duration or timeout: 60.17 seconds
    Build info: version: '3.12.0', revision: '7c6e0b3', time: '2018-05-08T15:15:08.936Z'
    System info: host: 'HKAUR7-QA', ip: '10.8.11.172', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_92'
    Driver info: driver.version: unknown
        at Object.checkLegacyResponse (D:\Selenium_Workspace\ProtractorJavaScriptProject5\node_modules\selenium-webdriver\lib\error.js:546:15)
        at parseHttpResponse (D:\Selenium_Workspace\ProtractorJavaScriptProject5\node_modules\selenium-webdriver\lib\http.js:509:13)
        at doSend.then.response (D:\Selenium_Workspace\ProtractorJavaScriptProject5\node_modules\selenium-webdriver\lib\http.js:441:30)
        at <anonymous>
        at process._tickCallback (internal/process/next_tick.js:188:7)
    From: Task: WebDriver.createSession()
        at Function.createSession (D:\Selenium_Workspace\ProtractorJavaScriptProject5\node_modules\selenium-webdriver\lib\webdriver.js:769:24)
        at Function.createSession (D:\Selenium_Workspace\ProtractorJavaScriptProject5\node_modules\selenium-webdriver\chrome.js:761:15)
        at createDriver (D:\Selenium_Workspace\ProtractorJavaScriptProject5\node_modules\selenium-webdriver\index.js:170:33)
        at Builder.build (D:\Selenium_Workspace\ProtractorJavaScriptProject5\node_modules\selenium-webdriver\index.js:626:16)
        at Hosted.getNewDriver (D:\Selenium_Workspace\ProtractorJavaScriptProject5\node_modules\protractor\built\driverProviders\driverProvider.js:53:33)
        at Runner.createBrowser (D:\Selenium_Workspace\ProtractorJavaScriptProject5\node_modules\protractor\built\runner.js:195:43)
        at q.then.then (D:\Selenium_Workspace\ProtractorJavaScriptProject5\node_modules\protractor\built\runner.js:339:29)
        at _fulfilled (D:\Selenium_Workspace\ProtractorJavaScriptProject5\node_modules\q\q.js:834:54)
        at self.promiseDispatch.done (D:\Selenium_Workspace\ProtractorJavaScriptProject5\node_modules\q\q.js:863:30)
        at Promise.promise.promiseDispatch (D:\Selenium_Workspace\ProtractorJavaScriptProject5\node_modules\q\q.js:796:13)
    [12:16:59] E/launcher - Process exited with error code 199

Please suggest.

Harinder
  • 39
  • 5
  • 1
    Possible duplicate of [org.openqa.selenium.WebDriverException: unknown error: DevToolsActivePort file doesn't exist while trying to initiate Chrome Browser](https://stackoverflow.com/questions/50642308/org-openqa-selenium-webdriverexception-unknown-error-devtoolsactiveport-file-d) – undetected Selenium Jun 18 '18 at 08:36
  • @DebanjanB, no issue is not the same as https://stackoverflow.com/questions/50642308/org-openqa-selenium-webdriverexception-unknown-error-devtoolsactiveport-file-d, I am trying to execute protractor script in eclipse. for reference please see https://www.protractortest.org/#/tutorial – Harinder Jun 18 '18 at 08:48
  • Now I am able to run the scripts on chrome as it was the version compatibility issues. i was running the script on latest chrome v.67, then i downgrade to v.66. – Harinder Jun 19 '18 at 04:41
  • That sounds great !!! – undetected Selenium Jun 19 '18 at 06:56

1 Answers1

0

I got the same error message because I was using an outdated version of chrome with chromedriver-2.40. The release notes for chromedriver-2.40 say that it supports chrome versions 66-68. Upgrading from the older version to chrome 67 fixed the error for me.

bstpierre
  • 30,042
  • 15
  • 70
  • 103