I've tried any solution on google results about this issue, but nothing is help.
Please help me to figure this out,
thanks!
Protractor conf:
exports.config = {
chromeDriver: 'npm/node_modules/protractor/selenium/chromedriver',
chromeOnly: false,
seleniumAddress: 'http://localhost:4444/wd/hub',
specs: ['c:\\automation\\tests\\testCases\\newApp\\screenshotsTesting.js'],
multiCapabilities: [{
'browserName': 'firefox',
'cli': {
'args': ['webdriver.firefox.useExisting=default']
// 'args': ['webdriver.firefox.useExisting=default', '-jsconsole', '-jsdebugger']
}},
{
'browserName': 'chrome',
'chromeOptions': {
args: ['--test-type','--memory-metrics','--console','--crash-on-failure']
// '--load-extension=' + 'C:\\Users\\idan\\AppData\\Local\\Google\\Chrome\\User Data\\Default\\Extensions\\idgpnmonknjnojddfkpgkljpfnnfcklj\\1.2.4_0'
}
}},
{
'browserName': 'internet explorer'
'platform': 'ANY',
'version': '11'
}],
// maxSessions: 1,
// rootElement: '.main',
framework: "jasmine",
allScriptsTimeout: 60000,
getPageTimeout: 60000,
....
IE11 tools - all zone level are the same and enabled:
Selenium WD launching:
java -Dwebdriver.ie.driver=C:\automation\npm\node_modules\selenium-standalone\.selenium\iedriver\IEDriverServer.exe -jar C:\automation\npm\node_modules\selenium-standalone\.selenium\selenium-server\2.45.0-server.jar
Protractor launching:
c:\automation\tests\protractor-conf.js --browser="internet explorer" --seleniumAddress=http://localhost:4444/wd/hub
Error from Selenium webdriver console:
Caused by: org.openqa.selenium.remote.SessionNotFoundException: Unexpected error
launching Internet Explorer. Protected Mode settings are not the same for all z
ones. Enable Protected Mode must be set to the same value (enabled or disabled)
for all zones. (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 1.04 seconds
Build info: version: '2.45.0', revision: '5017cb8', time: '2015-02-26 23:59:50'
System info: host: 'vCitaQA', ip: '192.168.152.1', os.name: 'Windows 8.1', os.ar
ch: 'amd64', os.version: '6.3', java.version: '1.8.0_25'
Driver info: org.openqa.selenium.ie.InternetExplorerDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
rce)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.
java:204)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHa
ndler.java:162)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.ja
va:599)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriv
er.java:240)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriv
er.java:225)
at org.openqa.selenium.ie.InternetExplorerDriver.run(InternetExplorerDri
ver.java:182)
at org.openqa.selenium.ie.InternetExplorerDriver.<init>(InternetExplorer
Driver.java:174)
at org.openqa.selenium.ie.InternetExplorerDriver.<init>(InternetExplorer
Driver.java:150)
... 14 more
09:19:13.656 WARN - Exception: Unexpected error launching Internet Explorer. Pro
tected Mode settings are not the same for all zones. Enable Protected Mode must
be set to the same value (enabled or disabled) for all zones. (WARNING: The serv
er did not provide any stacktrace information)
Command duration or timeout: 1.04 seconds
Build info: version: '2.45.0', revision: '5017cb8', time: '2015-02-26 23:59:50'
System info: host: 'vCitaQA', ip: '192.168.152.1', os.name: 'Windows 8.1', os.ar
ch: 'amd64', os.version: '6.3', java.version: '1.8.0_25'
Driver info: org.openqa.selenium.ie.InternetExplorerDriver
Related
Angular I am trying to open new tab with URL,
let windowIroh = window.open(URL, '_blank'); /
let windowIroh2 =window.open(URL, '_blank','width=10,height=10');
let windowIroh3 = window.open(URL, '_blank','width=10,height=10');
After setTimeout closed all open tab
setTimeout(() => {
windowIroh?.close();
windowIroh2?.close();
windowIroh3?.close();
}, 5000);
I have checked it in local, unit test case got success and build also fine but it got failed in CICD pipeline,
karmaConfig
browsers: [ 'ChromeHeadless_without_security'],
customLaunchers: {
ChromeHeadless_without_security: {
base: 'ChromeHeadless',
options: {
windowName: 'new-window',
settings: {
webSecurityEnabled: false
},
},
flags: [
'--no-sandbox',
'--disable-gpu',
'--reduce-security-for-testing',
'--allow-insecure-localhost',
'--disable-web-security',
'--disable-site-isolation-trials',
'--disable-setuid-sandbox'
],
How to resolve this problem in Jenkins CICD pipeline
16:30:28 time=2023-01-17T11:00:28.587Z level=INFO message="RETRY: received status 500 from external call"
16:30:30 17 01 2023 03:00:30.300:WARN [Chrome Headless 92.0.4515.107 (Linux x86_64)]: Disconnected (0 times)reconnect failed before timeout of 30000ms (transport close)
16:30:30 Chrome Headless 92.0.4515.107 (Linux x86_64) ERROR
16:30:30 Disconnectedreconnect failed before timeout of 30000ms (transport close)
16:30:30 Chrome Headless 92.0.4515.107 (Linux x86_64) ERROR
16:30:30 Disconnectedreconnect failed before timeout of 30000ms (transport close)
I found a strange behaviour at Minim Developer; when i run the following code in the console:
$(".form-group").has($(".control-label").withText("Description"))
.find(".cke_wysiwyg_frame").frames().find(".cke_editable").fill("Minium Test")
Minium is able to fill the field "Description"
But when I try to run the same code at the Step Definition, I have the following error:
org.mozilla.javascript.WrappedException: Wrapped
org.openqa.selenium.StaleElementReferenceException: stale element
reference: element is not attached to the page document (Session
info: chrome=68.0.3440.84) (Driver info: chromedriver=2.40.565498
(ea082db3280dd6843ebfb08a625e3eb905c4f5ab),platform=Windows NT
10.0.17134 x86_64) (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 0 milliseconds For
documentation on this error, please visit:
http://seleniumhq.org/exceptions/stale_element_reference.html Build
info: version: '3.8.1', revision: '6e95a6684b', time:
'2017-12-01T18:33:54.468Z' System info: host: '47ZZQC2', ip:
'169.254.70.131', os.name: 'Windows 10', os.arch: 'amd64', os.version:
'10.0', java.version: '1.8.0_172' Driver info:
org.openqa.selenium.remote.RemoteWebDriver Capabilities
{acceptInsecureCerts: false, acceptSslCerts: false,
applicationCacheEnabled: false, browserConnectionEnabled: false,
browserName: chrome, chrome: {chromedriverVersion: 2.40.565498
(ea082db3280dd6..., userDataDir: C:\Users\~1.SIL\AppDat...},
cssSelectorsEnabled: true, databaseEnabled: false, handlesAlerts:
true, hasTouchScreen: false, javascriptEnabled: true,
locationContextEnabled: true, mobileEmulationEnabled: false,
nativeEvents: true, networkConnectionEnabled: false, pageLoadStrategy:
normal, platform: XP, platformName: XP, rotatable: false,
setWindowRect: true, takesHeapSnapshot: true, takesScreenshot: true,
unexpectedAlertBehaviour: , unhandledPromptBehavior: , version:
68.0.3440.84, webStorageEnabled: true} Session ID: 103c08b587995e088faa269fbb46a4fd
(/minium/cucumber/internal/dsl.js#88(eval)#1) at
modules/forms.js:136 at modules/forms.js:175 at
modules/forms.js:204 at steps/General/steps.js:95
at ?.
When I fill the fields: features/Directory/Groups/groups.feature:48
Any ideias to solve this issue?
It seems an issue related to the use of interaction listener.
Are you adding any interaction listener to the browser configuration at world.js like this?
browser.configure()
.defaultTimeout(5, timeUnits.SECONDS)
.defaultInterval(500, timeUnits.MILLISECONDS)
.interactionListeners()
.add(minium.interactionListeners.onStaleElementReference().thenRetry())
.add(...)
...
.done();
If so, please move all the interaction Listeners to the Base Expression. For exmple:
base = $(":root")
.unless($(".modal").withCss("display", "block")).add(".modal-body")
.with(minium.interactionListeners.onStaleElementReference().thenRetry())
.with(...)
...
And run your code without the base expression, to avoid the call of interaction listener.
I am doing a angular exercise where i have to do a e2e test, when I run the protractor protractor.conf.js i have the following errors:
[launcher] Running 1 instances of WebDriver
(node:3032) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\atoms\error.js:108
var template = new Error(this.message);
^
SessionNotCreatedError: session not created exception
from unknown error: Runtime.executionContextCreated has invalid 'context': {"auxData":{"frameId":"6904.1","isDefault":true},"id":1,"name":"","origin":"://"}
(Session info: chrome=59.0.3071.86)
(Driver info: chromedriver=2.19.346078 (6f1f0cde889532d48ce8242342d0b84f94b114a1),platform=Windows NT 10.0 x86_64)
at new bot.Error (C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\atoms\error.js:108:18)
at Object.bot.response.checkResponse (C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\atoms\response.js:109:9)
at C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\webdriver.js:160:24
at promise.ControlFlow.runInFrame_ (C:/Users/Aurora/AppData/Roaming/npm/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/../webdriver/promise.js:1857:20)
at wrappedCtr.notify (C:/Users/Aurora/AppData/Roaming/npm/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/../webdriver/promise.js:2448:25)
at promise.Promise.notify_ (C:/Users/Aurora/AppData/Roaming/npm/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/../webdriver/promise.js:564:12)
at Array.forEach (native)
at promise.Promise.notifyAll_ (C:/Users/Aurora/AppData/Roaming/npm/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/../webdriver/promise.js:553:15)
at goog.async.run.processWorkQueue (C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\goog\async\run.js:130:15)
at <anonymous>
From: Task: WebDriver.createSession()
at Function.webdriver.WebDriver.acquireSession_ (C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\webdriver.js:157:22)
at Function.webdriver.WebDriver.createSession (C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\webdriver.js:131:30)
at new Driver (C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\chrome.js:810:36)
at DirectDriverProvider.getNewDriver (C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\lib\driverProviders\direct.js:68:16)
at Runner.createBrowser (C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\lib\runner.js:182:37)
at C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\lib\runner.js:263:21
at _fulfilled (C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:797:54)
at self.promiseDispatch.done (C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:826:30)
at Promise.promise.promiseDispatch (C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:759:13)
at C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:525:49
[launcher] Process exited with error code 1
Can anybody help me to figure out what's wrong?
I attach the file protractor.conf.js and the file that contain all the e2e tests that I execute on the application:
exports.config = {
allScriptsTimeout: 11000,
specs: [
'e2e/*.js'
],
capabilities: {
'browserName': 'chrome'
},
baseUrl: 'http://localhost:3001/',
framework: 'jasmine',
directConnect: true,
jasmineNodeOpts: {
defaultTimeoutInterval: 30000
}
};
'use strict';
describe('conFusion App E2E Testing', function() {
//Introduce the tests into this file
it('should automatically redirect to / when location hash/fragment is empty', function() {
browser.get('index.html');
expect(browser.getLocationAbsUrl()).toMatch("/");
});
//Set up a simple test for the index file to check if the page title is set correctly
describe('index', function() {
beforeEach(function() {
browser.get('index.html#/');
});
it('should have a title', function() {
expect(browser.getTitle()).
toEqual('Ristorante Con Fusion');
});
});
//We will navigate to the first menu item, and test a few properties there
describe('menu 0 item', function() {
beforeEach(function() {
browser.get('index.html#/menu/0');
});
it('should have a name', function() {
var name = element(by.binding('dish.name'));
expect(name.getText()).
toEqual('Uthapizza Hot $4.99');
});
it('should show the number of comments as', function() {
expect(element.all(by.repeater('comment in dish.comments'))
.count()).toEqual(7);
});
it('should show the first comment author as', function() {
element(by.model('critiria')).sendKeys('author');
expect(element.all(by.repeater('comment in dish.comments'))
.count()).toEqual(7);
var author = element.all(by.repeater('comment in dish.comments'))
.first().element(by.binding('comment.author'));
expect(author.getText()).toContain('25 Cent');
});
});
});
For a reason below, I've added Chromedriver Web Version 2.19 again and installed
Chrome version 44, I always get an error:
C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\http\index.js:172 callback(new Error(message)); ^ Error: ECONNREFUSED connect ECONNREFUSED 127.0.0.1:55368 at ClientRequest.
<anonymous> (C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\http\index.js:172:16) at emitOne (events.js:115:13) at ClientRequest.emit (events.js:210:7) at Socket.socketErrorListener (_http_client.js:399:9) at emitOne (events.js:115:13)
at Socket.emit (events.js:210:7) at emitErrorNT (internal/streams/destroy.js:62:8) at _combinedTickCallback (internal/process/next_tick.js:102:11) at process._tickCallback (internal/process/next_tick.js:161:9) From: Task: WebDriver.createSession() at
Function.webdriver.WebDriver.acquireSession_ (C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\webdriver.js:157:22) at Function.webdriver.WebDriver.createSession (C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\webdriver.js:131:30)
at new Driver (C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\chrome.js:810:36) at DirectDriverProvider.getNewDriver (C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\lib\driverProviders\direct.js:68:16)
at Runner.createBrowser (C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\lib\runner.js:182:37) at C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\lib\runner.js:263:21 at _fulfilled (C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:797:54)
at self.promiseDispatch.done (C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:826:30) at Promise.promise.promiseDispatch (C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:759:13) at C:\Users\Aurora\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:525:49
[launcher] Process exited with error code 1
You are using:
Chromedriver version 2.19
Chrome version 59
These two are not compatible - you need ChromeDriver 2.30 to work with Chrome 59:
Latest Release: ChromeDriver 2.30
Supports Chrome v58-60
Update your ChromeDriver. Typically done via:
webdriver-manager update
I wanted to automate a native app (calculator app) on Android using protractor. When I tried with the following configuration, I'm getting this error after app got launched and closed:
WebDriverError: Method has not yet been implemented
Is there solution for this? Here is my code:
exports.config = {
seleniumAddress: 'http://localhost:4723/wd/hub',
specs: ['spec.js'],
capabilities:{
'appium-version': '1.5.3',
platformName: 'Android',
platformVersion: '5.1.1',
deviceName: 'Nexus 5',
browserName: "android",
appPackage: 'com.android.calculator2',
appActivity: '.Calculator',
newCommandTimeout: 6000,
fulReset: true
}
onPrepare: function () {
var wd = require('wd'),
protractor = require('protractor'),
wdBridge = require('wd-bridge')(protractor, wd);
wdBridge.initFromProtractor(exports.config);
}
};
it("",function(){
element(by.id('com.android.calculator2:id/digit_7')).click();
element(by.name('minus')).click();
element(by.id('com.android.calculator2:id/digit_3')).click();
element(by.name('equals')).click();
});
I'm really new to Protractor and everything NodeJS, and i'm trying to get started using Protractor with AngularJS.
I used the Yeoman generator-gulp-angular to generate a project and all is well, but when i try to protractor protractor.conf.js (i've installed Java and Chromium) the following happens:
vagrant#server:/var/www/html/project/$ protractor protractor.conf.js
Starting selenium standalone server...
[launcher] Running 1 instances of WebDriver
Selenium standalone server started at http://192.168.103.173:38573/wd/hub
It hangs here for 1 minute, and then spurts out the following:
/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/atoms/error.js:113
var template = new Error(this.message);
^
UnknownError: unknown error: Chrome failed to start: exited abnormally
(Driver info: chromedriver=2.14.313457 (3d645c400edf2e2c500566c9aa096063e707c9cf),platform=Linux 3.13.0-24-generic x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 60.69 seconds
Build info: version: '2.45.0', revision: '5017cb8', time: '2015-02-26 23:59:50'
System info: host: 'server', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '3.13.0-24-generic', java.version: '1.7.0_75'
Driver info: org.openqa.selenium.chrome.ChromeDriver
at new bot.Error (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/atoms/error.js:113:18)
at Object.bot.response.checkResponse (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/atoms/response.js:106:9)
at /usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:152:24
at /usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/base.js:1582:15
at [object Object].webdriver.promise.ControlFlow.runInNewFrame_ (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/promise.js:1654:20)
at notify (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/promise.js:465:12)
at notifyAll (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/promise.js:442:7)
at resolve (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/promise.js:420:7)
at fulfill (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/promise.js:535:5)
at /usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/base.js:1582:15
==== async task ====
WebDriver.createSession()
at Function.webdriver.WebDriver.acquireSession_ (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:149:22)
at Function.webdriver.WebDriver.createSession (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:123:30)
at Builder.build (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/builder.js:294:22)
at DriverProvider.getNewDriver (/usr/local/lib/node_modules/protractor/lib/driverProviders/driverProvider.js:38:7)
at Runner.createBrowser (/usr/local/lib/node_modules/protractor/lib/runner.js:180:37)
at /usr/local/lib/node_modules/protractor/lib/runner.js:257:21
at _fulfilled (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:797:54)
at self.promiseDispatch.done (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:826:30)
at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:759:13)
[launcher] Process exited with error code 1
And exits.
This is my protractory.conf.js:
'use strict';
var paths = require('./.yo-rc.json')['generator-gulp-angular'].props.paths;
exports.config = {
node_modules/protractor/config.json
capabilities: {
'browserName': 'chrome'
},
specs: [paths.e2e + '/**/*.js'],
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000
}
};
I hope someone can help me out!
EDIT
I've added my (single) test code to provide more insight:
'use strict';
describe('The main view', function () {
var page;
beforeEach(function () {
browser.get('http://localhost:3000/index.html');
page = require('./main.po');
});
it('Should display the homepage', function() {
expect(page.header.getText()).toContain("Home");
});
});
And my Page Object file:
'use strict';
var MainPage = function() {
this.header = element(by.tagName('header'));
};
module.exports = new MainPage();