I used the below protractor cucumber multiCapabilities config file to execute my scenarios. While executing the config file, First time Chrome and Firefox got launched and my expected scenario got executed. But after the execution the job not got finished. The webdriver keep on launching the browsers and ending with 0 scenarios / 0 steps / 0m00.000s results. Can anyone help me to handle this situation.
Config file:
exports.config = {
seleniumAddress: "http://localhost:4444/wd/hub",
baseUrl: "https://www.google.co.in/",
multiCapabilities: [
{
browserName: "chrome",
shardTestFiles: true,
maxInstances: 1
},
{
browserName: "firefox",
shardTestFiles: true,
maxInstances: 1
}
],
framework: "custom",
frameworkPath: require.resolve("protractor-cucumber-framework"),
specs: ["../features/*.feature"],
cucumberOpts: {
format: 'json:results.json',
require: ["../stepDefinitions/*.js"],
tags: ['#sample']
}
};
Output:
I/launcher - 2 instance(s) of WebDriver still running
I/testLogger -
------------------------------------
I/testLogger - [chrome #01-0] PID: XXXXX
#Expected scenario got executed
I/launcher - 2 instance(s) of WebDriver still running
I/testLogger -
------------------------------------
I/testLogger - [firefox #11-0] PID: XXXXX
#Expected scenario got executed
I/launcher - 2 instance(s) of WebDriver still running
I/testLogger -
------------------------------------
I/testLogger - [firefox #11-1] PID: XXXXX
[firefox #11-1] 0 scenarios
[firefox #11-1] 0 steps
[firefox #11-1] 0m00.000s
I/launcher - 2 instance(s) of WebDriver still running
I/testLogger -
------------------------------------
I/testLogger - [chrome #01-1] PID: XXXXX
[chrome #01-1] 0 scenarios
[chrome #01-1] 0 steps
[chrome #01-1] 0m00.000s
And the webdriver keep on execution the scenarios until I manually terminate the job.
Related
my objective:
is to successfully publish my coverage report in a pipeline on azure devops.
To send it to SonarCloud
my successes
locally on my pc
I manage to generate the coverage report in html format and also in xml
1. script task on my pipeline:
- script: |
npx ng test --code-coverage --karma-config src/karma-ci.conf.js
condition: succeededOrFailed()
displayName: Generate unit tests report
2. kama-ci.config.js file:
module.exports = function (config) {
config.set({
frameworks: ['jasmine', '#angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-junit-reporter'),
require('karma-coverage'),
require('karma-coverage-istanbul-reporter'),
require('#angular-devkit/build-angular/plugins/karma')
],
junitReporter: {
outputDir: 'TestResults/junit',
outputFile: 'unittest-results.xml',
useBrowserName: false
},
coverageReporter: {
type : 'cobertura',
dir : 'TestResults',
subdir: 'coverage',
file: 'code-coverage.xml'
},
reporters: ['progress', 'junit', 'coverage'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: false,
customLaunchers: {
ChromeHeadless: {
base: 'Chrome',
flags: [
'--headless',
'--disable-gpu',
'--no-sandbox',
'--remote-debugging-port=9222',
]
}
},
browsers: ['ChromeHeadless'],
singleRun: true
});
};
3. Result error:
But the problem is, report generation always starts and fails in the pipeline.
Here is his result, despite the fact that I give it the condition of always succeeding.
2021-06-02T14:50:42.8314347Z ##[section]Starting: Generate unit tests
2021-06-02T14:50:42.8319061Z ==============================================================================
2021-06-02T14:50:42.8319314Z Task : Command line
2021-06-02T14:50:42.8319582Z Description : Run a command line script using Bash on Linux and macOS and cmd.exe on Windows
2021-06-02T14:50:42.8319857Z Version : 2.182.0
2021-06-02T14:50:42.8320038Z Author : Microsoft Corporation
2021-06-02T14:50:42.8320318Z Help : https://learn.microsoft.com/azure/devops/pipelines/tasks/utility/command-line
2021-06-02T14:50:42.8320658Z ==============================================================================
2021-06-02T14:50:42.9528480Z Generating script.
2021-06-02T14:50:42.9529859Z Script contents:
2021-06-02T14:50:42.9530447Z npx ng test --code-coverage --karma-config src/karma-ci.conf.js
2021-06-02T14:50:42.9530922Z ========================== Starting Command Output ===========================
2021-06-02T14:50:42.9558445Z [command]/bin/bash --noprofile --norc /home/vsts/work/_temp/7177135e-e9ad-4ecf-b6f1-86193e021ca3.sh
2021-06-02T14:51:01.5747869Z [32m02 06 2021 14:51:01.570:INFO [karma-server]: [39mKarma v3.1.4 server started at http://0.0.0.0:9876/
2021-06-02T14:51:01.5749272Z [32m02 06 2021 14:51:01.573:INFO [launcher]: [39mLaunching browsers ChromeHeadless with concurrency unlimited
2021-06-02T14:51:01.5774208Z [32m02 06 2021 14:51:01.577:INFO [launcher]: [39mStarting browser Chrome
2021-06-02T14:51:03.4612458Z
2021-06-02T14:51:03.4614556Z ERROR in [96mapp/services/dealflow-secondary.service.ts[0m:[93m4[0m:[93m37[0m - [91merror[0m[90m TS2307: [0mCannot find module '../entities/ISecondaryPortfolio'.
2021-06-02T14:51:03.4615270Z
2021-06-02T14:51:03.4616058Z [7m4[0m import { ISecondaryPortfolio } from '../entities/ISecondaryPortfolio';
2021-06-02T14:51:03.4616981Z [7m [0m [91m ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~[0m
2021-06-02T14:51:03.4618161Z [96mapp/shared/api/geography.api.ts[0m:[93m8[0m:[93m27[0m - [91merror[0m[90m TS2307: [0mCannot find module 'src/app/ui/funds/fund-list/models/Geography'.
2021-06-02T14:51:03.4618794Z
2021-06-02T14:51:03.4619553Z [7m8[0m import { Geography } from 'src/app/ui/funds/fund-list/models/Geography';
2021-06-02T14:51:03.4620454Z [7m [0m [91m ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~[0m
2021-06-02T14:51:03.4621635Z [96mapp/shared/services/geography.service.ts[0m:[93m2[0m:[93m27[0m - [91merror[0m[90m TS2307: [0mCannot find module 'src/app/ui/funds/fund-list/models/Geography'.
2021-06-02T14:51:03.4622232Z
2021-06-02T14:51:03.4622986Z [7m2[0m import { Geography } from 'src/app/ui/funds/fund-list/models/Geography';
2021-06-02T14:51:03.4623886Z [7m [0m [91m ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~[0m
2021-06-02T14:51:03.4625110Z [96mapp/ui/dealflow/add-fund-portfolio/add-fund-portfolio.component.ts[0m:[93m7[0m:[93m37[0m - [91merror[0m[90m TS2307: [0mCannot find module 'src/app/entities/ISecondaryPortfolio'.
2021-06-02T14:51:03.4625760Z
2021-06-02T14:51:03.4626506Z [7m7[0m import { ISecondaryPortfolio } from 'src/app/entities/ISecondaryPortfolio';
2021-06-02T14:51:03.4627440Z [7m [0m [91m ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~[0m
2021-06-02T14:51:03.4628643Z [96mapp/ui/dealflow/dealflow.service.ts[0m:[93m13[0m:[93m37[0m - [91merror[0m[90m TS2307: [0mCannot find module '../../entities/ISecondaryPortfolio'.
2021-06-02T14:51:03.4629250Z
2021-06-02T14:51:03.4629996Z [7m13[0m import { ISecondaryPortfolio } from '../../entities/ISecondaryPortfolio';
2021-06-02T14:51:03.4630925Z [7m [0m [91m ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~[0m
2021-06-02T14:51:03.4632053Z [96mapp/ui/dealflow/models/DealFlow.ts[0m:[93m1[0m:[93m37[0m - [91merror[0m[90m TS2307: [0mCannot find module 'src/app/entities/ISecondaryPortfolio'.
2021-06-02T14:51:03.4632630Z
2021-06-02T14:51:03.4633391Z [7m1[0m import { ISecondaryPortfolio } from "src/app/entities/ISecondaryPortfolio";
2021-06-02T14:51:03.4634782Z [7m [0m [91m ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~[0m
2021-06-02T14:51:03.4636019Z [96mapp/ui/dealflow/project-secondary/project-secondary.component.ts[0m:[93m15[0m:[93m37[0m - [91merror[0m[90m TS2307: [0mCannot find module '../../../entities/ISecondaryPortfolio'.
2021-06-02T14:51:03.4638214Z
2021-06-02T14:51:03.4640037Z [7m15[0m import { ISecondaryPortfolio } from '../../../entities/ISecondaryPortfolio';
2021-06-02T14:51:03.4641024Z [7m [0m [91m ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~[0m
2021-06-02T14:51:03.4642193Z [96mapp/ui/dealflow/send-to-mdm-popup/send-to-mdm-popup.component.ts[0m:[93m5[0m:[93m30[0m - [91merror[0m[90m TS2307: [0mCannot find module 'src/app/entities/IMDMResponse'.
2021-06-02T14:51:03.4642778Z
2021-06-02T14:51:03.4643427Z [7m5[0m import { IMDMResponse } from 'src/app/entities/IMDMResponse';
2021-06-02T14:51:03.4644246Z [7m [0m [91m ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~[0m
2021-06-02T14:51:03.4645318Z [96mapp/ui/dealflow/tests-dealflow/dealflow.spec.ts[0m:[93m1[0m:[93m37[0m - [91merror[0m[90m TS2307: [0mCannot find module '../../../entities/ISecondaryPortfolio'.
2021-06-02T14:51:03.4645885Z
2021-06-02T14:51:03.4646561Z [7m1[0m import { ISecondaryPortfolio } from '../../../entities/ISecondaryPortfolio';
2021-06-02T14:51:03.4647398Z [7m [0m [91m ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~[0m
2021-06-02T14:51:03.4648510Z [96mapp/ui/funds/fund-list/create-fund/create-fund.component.spec.ts[0m:[93m2[0m:[93m27[0m - [91merror[0m[90m TS2307: [0mCannot find module '../models/Geography'.
2021-06-02T14:51:03.4649050Z
2021-06-02T14:51:03.4649676Z [7m2[0m import { Geography } from '../models/Geography';
2021-06-02T14:51:03.4650403Z [7m [0m [91m ~~~~~~~~~~~~~~~~~~~~~[0m
2021-06-02T14:51:03.4651471Z [96mapp/ui/funds/fund-list/create-fund/create-fund.component.ts[0m:[93m15[0m:[93m27[0m - [91merror[0m[90m TS2307: [0mCannot find module '../models/Geography'.
2021-06-02T14:51:03.4652001Z
2021-06-02T14:51:03.4652603Z [7m15[0m import { Geography } from '../models/Geography';
2021-06-02T14:51:03.4653352Z [7m [0m [91m ~~~~~~~~~~~~~~~~~~~~~[0m
2021-06-02T14:51:03.4653685Z
2021-06-02T14:51:03.5172693Z ##[error]Bash exited with code '1'.
2021-06-02T14:51:03.5208748Z ##[section]Finishing: Generate unit tests
You should add "reporters" inside "coverageReporter" in your karma.config, like so:
coverageReporter: {
type : 'cobertura',
dir : 'TestResults',
subdir: 'coverage',
file: 'code-coverage.xml',
reporters: [ { type: 'cobertura' } ]
},
1. My project is:
Front end project with Node.Js and npm package
Angular CLI: 8.3.23
Node: 12.18.3
OS: win32 x64
Angular: 8.2.14
1. i show you my pipeline
trigger:
tags:
include:
- v*
variables:
- name: ARTIFACTS_FEED_NAME
value: MyFeed
stages:
- stage: Build
jobs:
- job: Build
steps:
- task: NodeTool#0
inputs:
versionSpec: 10.15.x
displayName: Install and use 10.x Node.js version
- task: Npm#1
inputs:
command: install
customRegistry: useFeed
customFeed: $(ARTIFACTS_FEED_NAME)
displayName: Packages restore
- script: |
ls
displayName: Check source output
- script: |
npx ng test --code-coverage --karma-config src/karma-ci.conf.js
condition: succeededOrFailed()
displayName: Generate unit tests report
- script: |
ls src
displayName: Check unit tests output
- task: PublishTestResults#2
condition: succeededOrFailed()
inputs:
testResultsFormat: 'JUnit'
testResultsFiles: '**/TestResults/junit/unittest-results.xml'
displayName: Publish unit test results
- task: PublishCodeCoverageResults#1
displayName: Publish code coverage report
condition: succeededOrFailed()
inputs:
codeCoverageTool: Cobertura
# summaryFileLocation: '$(Build.SourcesDirectory)/coverage/**/TestResults/code-coverage.xml'
summaryFileLocation: '**/src/TestResults/coverage/code-coverage.xml'
failIfCoverageEmpty: true
I use the following function in the protractor test. Test run causes stale element reference: element is not attached to the page document is thrown. The test is being executed for various page versions.
openPointDescription: function(){
widget.points.each(function(point){
widget.pointDescription.container.isPresent().then(function(present){
if (!present)
{
browser.actions().mouseMove(point).click().perform().then();
}
})
});
}
Where:
widget.points: element.all(by.tagWithAttributeRegex('img', 'src', '.*marker.png')),
pointDescritption.container: element(by.css('div[class=bp-point-desc]')),
Stacktrace indicates mouseMove function
[chrome #01-13] - Failed: stale element reference: element is not attached to the page document
[chrome #01-13] (Session info: headless chrome=90.0.4430.85)
[chrome #01-13] (Driver info: chromedriver=90.0.4430.24 (4c6d850f087da467d926e8eddb76550aed655991-refs/branch-heads/4430#{#429}),platform=Linux 4.4.0-187-generic x86_64)
[chrome #01-13] (Session info: headless chrome=90.0.4430.85)
[chrome #01-13] (Driver info: chromedriver=90.0.4430.24 (4c6d850f087da467d926e8eddb76550aed655991-refs/branch-heads/4430#{#429}),platform=Linux 4.4.0-187-generic x86_64)
[chrome #01-13] at Object.checkLegacyResponse (/var/app/node_modules/selenium-webdriver/lib/error.js:546:15)
[chrome #01-13] at parseHttpResponse (/var/app/node_modules/selenium-webdriver/lib/http.js:509:13)
[chrome #01-13] at /var/app/node_modules/selenium-webdriver/lib/http.js:441:30
[chrome #01-13] at processTicksAndRejections (internal/process/task_queues.js:97:5)
[chrome #01-13] From: Task: mouseMove
[chrome #01-13] at thenableWebDriverProxy.schedule (/var/app/node_modules/selenium-webdriver/lib/webdriver.js:807:17)
[chrome #01-13] at /var/app/node_modules/selenium-webdriver/lib/actions.js:124:23
[chrome #01-13] at Array.map (<anonymous>)
[chrome #01-13] at /var/app/node_modules/selenium-webdriver/lib/actions.js:123:29
[chrome #01-13] at TaskQueue.execute_ (/var/app/node_modules/selenium-webdriver/lib/promise.js:3084:14)
[chrome #01-13] at TaskQueue.executeNext_ (/var/app/node_modules/selenium-webdriver/lib/promise.js:3067:27)
[chrome #01-13] at /var/app/node_modules/selenium-webdriver/lib/promise.js:2927:27
[chrome #01-13] at /var/app/node_modules/selenium-webdriver/lib/promise.js:668:7
[chrome #01-13] at processTicksAndRejections (internal/process/task_queues.js:97:5)
[chrome #01-13] From: Task: ActionSequence.perform
[chrome #01-13] at ActionSequence.perform (/var/app/node_modules/selenium-webdriver/lib/actions.js:122:33)
[chrome #01-13] at /var/app/src/widget/widget.pageController.js:31:68
[chrome #01-13] at ManagedPromise.invokeCallback_ (/var/app/node_modules/selenium-webdriver/lib/promise.js:1376:14)
[chrome #01-13] at TaskQueue.execute_ (/var/app/node_modules/selenium-webdriver/lib/promise.js:3084:14)
[chrome #01-13] at TaskQueue.executeNext_ (/var/app/node_modules/selenium-webdriver/lib/promise.js:3067:27)
[chrome #01-13] at /var/app/node_modules/selenium-webdriver/lib/promise.js:2927:27
[chrome #01-13] at /var/app/node_modules/selenium-webdriver/lib/promise.js:668:7
[chrome #01-13] at processTicksAndRejections (internal/process/task_queues.js:97:5)
[chrome #01-13] From: Task: Run it("displays point description after clicking on a valid point") in control flow
[chrome #01-13] at UserContext.<anonymous> (/var/app/node_modules/jasminewd2/index.js:94:19)
[chrome #01-13] From asynchronous test:
[chrome #01-13] Error
[chrome #01-13] at Suite.<anonymous> (/var/app/src/widget/spec/genericSpec.js:21:13)
[chrome #01-13] at Object.generateDescribe (/var/app/src/widget/spec/genericSpec.js:8:9)
[chrome #01-13] at Object.<anonymous> (/var/app/src/widget/spec/widget5.9.spec.js:5:13)
[chrome #01-13] at Module._compile (internal/modules/cjs/loader.js:1147:30)
[chrome #01-13] at Object.Module._extensions..js (internal/modules/cjs/loader.js:1167:10)
[chrome #01-13] at Module.load (internal/modules/cjs/loader.js:996:32)
[chrome #01-13]
90% chance the problem is .each. Try with for loop instead. But I never worked with .then syntax, so using async/await
async openPointDescription: function() {
for(let i=0; i<await widget.points.count(); i++) {
if (!(await widget.pointDescription.container.isPresent())) { // it looks like this has to go outside of for loop
await browser.actions().mouseMove(widget.points.get(i)).perform()
await widget.points.get(i).click()
}
}
I'm new to protractor and am going through the tutorial. The setup and Step 0 worked fine for me but I had an unexpected error in Step 1:
$ protractor conf.js
[13:11:41] I/launcher - Running 1 instances of WebDriver
[13:11:41] I/hosted - Using the selenium server at http://localhost:4444/wd/hub
Started
seeking `first`
seeking `second`
seeking `gobutton`
seeking `latest`
F
Failures:
1) Protractor Demo App should add one and two
Message:
Failed: element not visible
(Session info: chrome=60.0.3112.78)
(Driver info: chromedriver=2.31.488763 (092de99f48a300323ecf8c2a4e2e7cab51de5ba8),platform=Linux 4.4.0-87-generic x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 43 milliseconds
Build info: version: '3.4.0', revision: 'unknown', time: 'unknown'
System info: host: 'pfuntner1', ip: '9.42.83.35', os.name: 'Linux', os.arch: 'amd64', os.version: '4.4.0-87-generic', java.version: '1.8.0'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{applicationCacheEnabled=false, rotatable=false, mobileEmulationEnabled=false, networkConnectionEnabled=false, chrome={chromedriverVersion=2.31.488763 (092de99f48a300323ecf8c2a4e2e7cab51de5ba8), userDataDir=/tmp/.org.chromium.Chromium.ZhadTr}, takesHeapSnapshot=true, pageLoadStrategy=normal, databaseEnabled=false, handlesAlerts=true, hasTouchScreen=false, version=60.0.3112.78, platform=LINUX, browserConnectionEnabled=false, nativeEvents=true, acceptSslCerts=true, locationContextEnabled=true, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true, setWindowRect=true, unexpectedAlertBehaviour=}]
Session ID: cf611f619dbf2069413885ed9bcbba17
Stack:
ElementNotVisibleError: element not visible
(Session info: chrome=60.0.3112.78)
(Driver info: chromedriver=2.31.488763 (092de99f48a300323ecf8c2a4e2e7cab51de5ba8),platform=Linux 4.4.0-87-generic x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 43 milliseconds
Build info: version: '3.4.0', revision: 'unknown', time: 'unknown'
System info: host: 'pfuntner1', ip: '9.42.83.35', os.name: 'Linux', os.arch: 'amd64', os.version: '4.4.0-87-generic', java.version: '1.8.0'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{applicationCacheEnabled=false, rotatable=false, mobileEmulationEnabled=false, networkConnectionEnabled=false, chrome={chromedriverVersion=2.31.488763 (092de99f48a300323ecf8c2a4e2e7cab51de5ba8), userDataDir=/tmp/.org.chromium.Chromium.ZhadTr}, takesHeapSnapshot=true, pageLoadStrategy=normal, databaseEnabled=false, handlesAlerts=true, hasTouchScreen=false, version=60.0.3112.78, platform=LINUX, browserConnectionEnabled=false, nativeEvents=true, acceptSslCerts=true, locationContextEnabled=true, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true, setWindowRect=true, unexpectedAlertBehaviour=}]
.
.
.
I added debugging statements to spec.js to try to identify what element it can't find. It appears to find the two input fields and the button fine but does not find the output field.
Here is my spec.js:
// spec.js
describe('Protractor Demo App', function() {
it('should add one and two', function() {
browser.get('http://juliemr.github.io/protractor-demo/');
console.log("seeking `first`");
element(by.model('first')).sendKeys(1);
console.log("seeking `second`");
element(by.model('second')).sendKeys(2);
console.log("seeking `gobutton`");
element(by.id('gobutton')).click();
console.log("seeking `latest`");
expect(element(by.binding('latest')).getText()).toEqual('5'); // This is wrong!
});
});
Am I doing something wrong?
Now there are few possible things happening here
The element that is returned by element(by.binding('latest')) is not the correct one
There are multiple elements matching element(by.binding('latest')) and the first one is being returned to you
The element being returned to you is not visible on the screen. Chromedriver is very specific when it comes to taking actions on element which are visible to the user. If the element is not visible to user a automation shouldn't be able to simulate action on it (not 100% true, because some actions can still be taken).
So make sure you are getting the right element and there are no multiple matches
Protractor : 5.0.0, IE11, IEDriverServer_Win32_3.0.0.exe
conf file:
capabilities: {
browserName: 'internet explorer',
}
localSeleniumStandaloneOpts: {
jvmArgs: ["-Dwebdriver.ie.driver=.\\node_modules\\protractor\\node_modules\\webdriver-manager\\selenium\\IEDriverServer.exe"]
}
IE browsers opens up but doesn't do anything. Following is the error
[11:12:22] I/local - Starting selenium standalone server...
[11:12:22] I/launcher - Running 1 instances of WebDriver
[11:12:23] I/local - Selenium standalone server started at http://192.168.56.1:53122/wd/hub
Started
A Jasmine spec timed out. Resetting the WebDriver Control Flow.
F[11:12:26] E/launcher - Unable to get browser (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 15 milliseconds
Build info: version: '3.0.1', revision: '1969d75', time: '2016-10-18 09:48:19 -0700'
System info: host: 'RLAPTOP', ip: '', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_111'
Driver info: org.openqa.selenium.ie.InternetExplorerDriver
Capabilities [{browserAttachTimeout=0, ie.enableFullPageScreenshot=true, enablePersistentHover=true, ie.forceCreateProcessApi=false, ie.forceShellWindowsApi=false, pageLoadStrategy=normal, ignoreZoomSetting=false, ie.fileUploadDialogTimeout=3000, version=11, platform=WINDOWS, nativeEvents=true, ie.ensureCleanSession=false, elementScrollBehavior=0, ie.browserCommandLineSwitches=, requireWindowFocus=false, browserName=internet explorer, initialBrowserUrl=http://localhost:36498/, javascriptEnabled=true, ignoreProtectedModeSettings=false, enableElementCacheCleanup=true, unexpectedAlertBehaviour=dismiss}]
Session ID: e830e362-bb50-41bb-8b2d-cd4bd35f6d4d
[11:12:26] E/launcher - NoSuchWindowError: Unable to get browser (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 15 milliseconds
Build info: version: '3.0.1', revision: '1969d75', time: '2016-10-18 09:48:19 -0700'
System info: host: 'RLAPTOP', ip: '', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_111'
Driver info: org.openqa.selenium.ie.InternetExplorerDriver
Capabilities [{browserAttachTimeout=0, ie.enableFullPageScreenshot=true, enablePersistentHover=true, ie.forceCreateProcessApi=false, ie.forceShellWindowsApi=false, pageLoadStrategy=normal, ignoreZoomSetting=false, ie.fileUploadDialogTimeout=3000, version=11, platform=WINDOWS, nativeEvents=true, ie.ensureCleanSession=false, elementScrollBehavior=0, ie.browserCommandLineSwitches=, requireWindowFocus=false, browserName=internet explorer, initialBrowserUrl=http://localhost:36498/, javascriptEnabled=true, ignoreProtectedModeSettings=false, enableElementCacheCleanup=true, unexpectedAlertBehaviour=dismiss}]
Session ID: e830e362-bb50-41bb-8b2d-cd4bd35f6d4d
at WebDriverError (C:\QA\testingmaster\tests\protractor_tests\node_modules\selenium-webdriver\lib\error.js:27:5)
at NoSuchWindowError (C:\QA\testingmaster\tests\protractor_tests\node_modules\selenium-webdriver\lib\error.js:192:5)
at Object.checkLegacyResponse (C:\QA\testingmaster\tests\protractor_tests\node_modules\selenium-webdriver\lib\error.js:505:15)
at parseHttpResponse (C:\QA\testingmaster\tests\protractor_tests\node_modules\selenium-webdriver\lib\http.js:509:13)
at doSend.then.response (C:\QA\testingmaster\tests\protractor_tests\node_modules\selenium-webdriver\lib\http.js:440:13)
at process._tickCallback (internal/process/next_tick.js:103:7)
From: Task: WebDriver.getCurrentUrl()
at WebDriver.schedule (C:\QA\testingmaster\tests\protractor_tests\node_modules\selenium-webdriver\lib\webdriver.js:816:17)
at WebDriver.getCurrentUrl (C:\QA\testingmaster\tests\protractor_tests\node_modules\selenium-webdriver\lib\webdriver.js:1002:17)
at ScreenshotReporter.specDone (C:\QA\testingmaster\tests\protractor_tests\e2e\jasmine_reporters\screenshot_reporter.js:12:22)
at dispatch (C:\QA\testingmaster\tests\protractor_tests\node_modules\jasmine-core\lib\jasmine-core\jasmine.js:1966:28)
at ReportDispatcher.specDone (C:\QA\testingmaster\tests\protractor_tests\node_modules\jasmine-core\lib\jasmine-core\jasmine.js:1949:11)
at Spec.specResultCallback [as resultCallback] (C:\QA\testingmaster\tests\protractor_tests\node_modules\jasmine-core\lib\jasmine-core\jasmine.js:903:18)
at complete (C:\QA\testingmaster\tests\protractor_tests\node_modules\jasmine-core\lib\jasmine-core\jasmine.js:368:12)
at QueueRunner.clearStack (C:\QA\testingmaster\tests\protractor_tests\node_modules\jasmine-core\lib\jasmine-core\jasmine.js:660:9)
at QueueRunner.run (C:\QA\testingmaster\tests\protractor_tests\node_modules\jasmine-core\lib\jasmine-core\jasmine.js:1881:12)
at C:\QA\testingmaster\tests\protractor_tests\node_modules\jasmine-core\lib\jasmine-core\jasmine.js:1898:16
[11:12:26] E/launcher - Process exited with error code 199
Any suggestions? Do i need to start selenium server as well manually ?
i am brand new to protractor and did setup as per the instructions from the protractor website. When i try to run the protractor test with the a cucumber framework i always get "Error: Error: Cannot find module 'cucumber'". Any help on this? below are by configurations.
cucumber-conf.js
exports.config = {
seleniumAddress: 'http://localhost:4444/wd/hub',
capabilities: {
browserName:'chrome'
},
framework: 'custom',
frameworkPath: require.resolve('protractor-cucumber-framework'),
specs: [
'./cucumber/*.feature'
],
cucumberOpts: {
require: ['./cucumber/*.js'],
tags: [],
strict: true,
format: ["pretty"],
dryRun: false,
compiler: []
},
onPrepare: function () {
browser.manage().window().maximize();
}
};
when i run protractor cucumber-conf.js i get below error.
/opt/protractor_tests
➔ protractor cucumber-conf.js
(node:5681) DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
[12:06:55] I/launcher - Running 1 instances of WebDriver
[12:06:55] I/hosted - Using the selenium server at http://localhost:4444/wd/hub
[12:06:57] E/launcher - Error: Error: Cannot find module 'cucumber'
at Function.Module._resolveFilename (module.js:472:15)
at Function.Module._load (module.js:420:25)
at Module.require (module.js:500:17)
at require (internal/module.js:20:19)
at Object.module.exports.load (/opt/protractor_tests/node_modules/protractor-cucumber-framework/lib/cucumberLoader.js:5:12)
at Object.<anonymous> (/opt/protractor_tests/node_modules/protractor-cucumber-framework/index.js:5:48)
at Module._compile (module.js:573:32)
at Object.Module._extensions..js (module.js:582:10)
at Module.load (module.js:490:32)
at tryModuleLoad (module.js:449:12)
[12:06:57] E/launcher - Process exited with error code 100