Skip to content
This repository has been archived by the owner on Jul 29, 2024. It is now read-only.

Chrome driver opens and quits immediately in protractor typescript with cucumber #5349

Open
sujini576 opened this issue Nov 6, 2019 · 3 comments

Comments

@sujini576
Copy link

[09:10:06] I/launcher - Running 1 instances of WebDriver
[09:10:06] I/hosted - Using the selenium server at http://localhost:4444/wd/hub
Started

No specs found
Finished in 0.005 seconds

[09:10:08] I/launcher - 0 instance(s) of WebDriver still running
[09:10:08] I/launcher - chrome #1 passed

In other window where selenium server is up and running it gives the below message:

Starting ChromeDriver 78.0.3904.11 (eaaae9de6b8999773fa33f92ce1e1bbe294437cf-refs/branch-heads/3904@{#86}) on port 34887
Only local connections are allowed.
Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.
09:10:08.773 INFO [ProtocolHandshake.createSession] - Detected dialect: W3C
09:10:08.773 INFO [RemoteSession$Factory.lambda$performHandshake$0] - Started new session 1f3bce163c62c6fa4fd0a57b146a21e4 (org.openqa.selenium.chrome.ChromeDriverService)
09:10:08.914 INFO [ActiveSessions$1.onStop] - Removing session 1f3bce163c62c6fa4fd0a57b146a21e4 (org.openqa.selenium.chrome.ChromeDriverService)

@NicoForce
Copy link

Share your configuration file and project structure to help identify the issue.

@sujini576
Copy link
Author

This is the configuration.js file:

import { Config } from 'protractor';
export let config: Config = {
directConnect: true,
//framework: 'jasmine',
framework: "custom",
frameworkPath: require.resolve("protractor-cucumber-framework"),
capabilities: {
browserName: 'chrome',
},
specs: ['steps.js'],
useAllAngular2AppRoots: true,
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 100000,
noGlobals: true
}
};

Cucucmberconfig.ts file:
import { Config } from 'protractor';
import * as reporter from "cucumber-html-reporter";

export let config: Config = {
directConnect: true,
framework: 'custom',
frameworkPath: require.resolve('protractor-cucumber-framework'),
capabilities: {
browserName: 'chrome'
},
specs: ['../features/login.feature'],
cucumberOpts: {
format: "json:./cucumberreport.json",

    require: [
        './stepdefinitions/*.js',
    ]
},

onComplete: () => {
var options = {
theme: 'bootstrap',
jsonfile: './cucumberreport.json',
output: 'cucumber_report.html',
reportSuiteAsScenarios: true,
launchReport: true,
metadata: {
"App Version": "0.3.2",
"Test Environment": "STAGING",
"Browser": "Chrome 54.0.2840.98",
"Platform": "Windows 10",
"Parallel": "Scenarios",
"Executed": "Report",
}
};
reporter.generate
}
};

Project structure:
project structure

@harsha509
Copy link

hi @sujini576 ,

I see an issue as path to spec file is wrong. So protractor is unable to execute your test. Please give correct path of the spec file in specs:[]

Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants