Protractor not testing, WebDriver fails after 1 minute - javascript

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();

Related

I keep getting errors when trying to deploy smart contracts to my blockchain using truffle

I have a set of smart contracts that I have compiled and deployed to rinkeby test network. I now need to deploy the to a private goquorum blockchain that runs on the IBFT consensus. The blockchain was built with quorum-wizard. It starts when I run ./start.sh
when I'm in the root of my truffle project I run sudo truffle deploy --reset --network quorum
I get the following error.
> Everything is up to date, there is nothing to compile.
/root/dapp1/Dapp/node_modules/web3-core-helpers/src/errors.js:42
return new Error(message);
^
Error: PollingBlockTracker - encountered an error while attempting to update latest block:
Error: Invalid JSON RPC response: ""
at Object.InvalidResponse (/root/dapp1/Dapp/node_modules/web3-core-helpers/src/errors.js:42:16)
at XMLHttpRequest.request.onreadystatechange (/root/dapp1/Dapp/node_modules/web3-providers-http/src/index.js:92:32)
at XMLHttpRequestEventTarget.dispatchEvent (/root/dapp1/Dapp/node_modules/xhr2-cookies/xml-http-request-event-target.ts:44:13)
at XMLHttpRequest._setReadyState (/root/dapp1/Dapp/node_modules/xhr2-cookies/xml-http-request.ts:219:8)
at XMLHttpRequest._onHttpRequestError (/root/dapp1/Dapp/node_modules/xhr2-cookies/xml-http-request.ts:379:8)
at ClientRequest.<anonymous> (/root/dapp1/Dapp/node_modules/xhr2-cookies/xml-http-request.ts:266:37)
at ClientRequest.emit (events.js:315:20)
at Socket.socketOnEnd (_http_client.js:493:9)
at Socket.emit (events.js:327:22)
at endReadableNT (internal/streams/readable.js:1327:12)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
at PollingBlockTracker._performSync (/root/dapp1/Dapp/node_modules/eth-block-tracker/src/polling.js:51:24)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
This is my truffle-config.js
const HDWalletProvider = require("#truffle/hdwallet-provider");
const mnemonic = "not my real mn emon ic words this is pl cfff was";
module.exports = {
networks: {
rinkeby: {
provider: function() {
return new HDWalletProvider(mnemonic, "https://rinkeby.infura.io/v3/2342342342344345344343434");
},
network_id: '*',
timeoutBlocks: 100000,
networkCheckTimeout:2000000
},
// https://www.trufflesuite.com/docs/truffle/distributed-ledger-support/working-with-quorum
quorum: {
provider: function() {
return new HDWalletProvider(mnemonic, "http://127.0.0.1:21000/");
},
network_id: '*',
type: "quorum",
timeoutBlocks: 1000000,
networkCheckTimeout:20000000
}
},
compilers: {
solc: {
version: "0.5.0",
settings: {
optimizer: {
enabled: true, // Default: false
runs: 1000 // Default: 200
},
evmVersion: "homestead" // Default: "byzantium"
}
}
}
};
I am using
Node v14.16.1
Ubuntu 18.04 (64 Bit)
Quorum 21.1.0
Web3.js v1.3.5
Truffle v5.3.4 (core: 5.3.4)
solidity v0.5.0

Error 1 during test end to end

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

Protractor - Internet explorer driver doesn't run with selenium webdriver

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

Protractor - Unable to run protractor tests

My tests are throwing the following error. It used to run fine before. Please advise.
My Config file:
exports.config = {
seleniumAddress: 'http://localhost:4444/wd/hub',
allScriptsTimeout: 20000,
baseUrl: 'https://mylink/#/',
// frameworks to use
frameworks: ['jasmine'],
// Capabilities to be passed to the webdriver instance.
multiCapabilities: [{
'browserName': 'chrome'
//}, {
// 'browserName': 'firefox'
//
}],
// Spec patterns are relative to the current working directory.
specs: [
'tests/HomePage.js'
],
onPrepare: function() {
browser.driver.manage().window().maximize();
require('jasmine-reporters');
jasmine.getEnv().addReporter(
new jasmine.JUnitXmlReporter('xmloutput', true. true));
},
jasmineNodeOpts: {
showColors: true
}
}
My Spec file:
// spec.js
describe('MyTest homepage', function() {
var ptor;
require('protractor-linkuisref-locator')(protractor);
beforeEach(function() {
browser.ignoreSynchronization = true;
ptor = protractor.getInstance();
browser.rootEl = 'div';
//browser.driver.manage().window().setSize(1280, 1024);
browser.debugger();
});
it('Should enter homepage url and credentials', function() {
browser.get('/#/');
element(by.name('userName')).sendKeys('');
element(by.name('password')).sendKeys('');
element(by.xpath("//button[#class=' btn orange small wide']")).click();
});
it('Should the title contain', function() {
expect(browser.getTitle()).toEqual('');
});
it('Should click on the PowerGuide', function() {
element(by.linkUiSref('locator')).click();
ptor.sleep(100);
//expect(ptor.getCurrentUrl(locator)).toEqual('');
});
it('Should click on Month', function() {
element(by.id('month-tab')).click();
ptor.sleep(100);
});
//it('Should load the images', function() {
// element(by.css('.pure-u-1-2')).click();
//var icons = element.all(by.css('.pure-u-1-2')).click();
//icons.first().click();
//});
});
This is the error I am getting.
seleniumProcess.pid: 1380
14:43:45.163 INFO - Launching a standalone server
Setting system property webdriver.chrome.driver to C:\Users\sramamoorthy\AppData\Roaming\npm\node_modules\protractor\sel
enium\chromedriver.exe
14:43:45.342 INFO - Java: Oracle Corporation 25.40-b25
14:43:45.342 INFO - OS: Windows 7 6.1 amd64
14:43:45.373 INFO - v2.45.0, with Core v2.45.0. Built from revision 5017cb8
14:43:45.597 INFO - RemoteWebDriver instances should connect to: http://127.0.0.1:4444/wd/hub
14:43:45.597 INFO - Version Jetty/5.1.x
14:43:45.597 INFO - Started HttpContext[/selenium-server,/selenium-server]
14:43:45.779 INFO - Started org.openqa.jetty.jetty.servlet.ServletHandler#23223dd8
14:43:45.781 INFO - Started HttpContext[/wd,/wd]
14:43:45.781 INFO - Started HttpContext[/selenium-server/driver,/selenium-server/driver]
14:43:45.781 INFO - Started HttpContext[/,/]
14:43:45.789 INFO - Started SocketListener on 0.0.0.0:4444
14:43:45.789 INFO - Started org.openqa.jetty.jetty.Server#133314b
14:44:41.384 INFO - Executing: [new session: Capabilities [{count=1, browserName=chrome}]])
14:44:41.399 INFO - Creating a new session for Capabilities [{count=1, browserName=chrome}]
Starting ChromeDriver 2.14.313457 (3d645c400edf2e2c500566c9aa096063e707c9cf) on port 44385
Only local connections are allowed.
14:44:43.309 INFO - Done: [new session: Capabilities [{count=1, browserName=chrome}]]
14:44:43.567 INFO - Executing: [set script timeoutt: 20000])
14:44:43.584 INFO - Executing: [delete session: 64c8dac4-559f-416d-b77b-78c5184b6538])
14:44:43.590 INFO - Done: [set script timeoutt: 20000]
14:44:45.303 INFO - Done: [delete session: 64c8dac4-559f-416d-b77b-78c5184b6538]
Test Error: This is the error I am getting where i am calling the Conf.js file from
Using the selenium server at http://localhost:4444/wd/hub
[launcher] Running 1 instances of WebDriver
[launcher] Error: TypeError: undefined is not a function
at
at Object.exports.run (C:\Users\AppData\Roaming\npm\node_modules\protractor\lib\frameworks\jasmine.js:6
2:17)
at C:\Users\AppData\Roaming\npm\node_modules\protractor\lib\runner.js:326:35
at _fulfilled (C:\Users\sr\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:797:54)
at self.promiseDispatch.done (C:\Users\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:
826:30)
at Promise.promise.promiseDispatch (C:\Users\ppData\Roaming\npm\node_modules\protractor\node_modules\q
\q.js:759:13)
[launcher] Process exited with error code 100
There is a typo inside onPrepare():
onPrepare: function() {
browser.driver.manage().window().maximize();
require('jasmine-reporters');
jasmine.getEnv().addReporter(
new jasmine.JUnitXmlReporter('xmloutput', true. true));
// HERE^
},
You meant instead:
jasmine.getEnv().addReporter(
new jasmine.JUnitXmlReporter('xmloutput', true, true));
Error: TypeError: undefined is not a function
at
at Object.exports.run (C:\Users\AppData\Roaming\npm\node_modules\protractor\lib\frameworks\jasmine.js:6
The error is from the library. I think you might missed some dependencies that the library requires.
Removing this line fixed a similar problem for me:
seleniumAddress: 'http://localhost:4444/wd/hub',

Intern with Phantomjs GhostDriver

I'm trying to setup Intern to run with PhantomJS on a Windows 7 machine
Since now my setup is as follows:
demo test root/unit/tests/phantom.js:
define([
'intern!object',
'intern/chai!assert'
], function(registerSuite, assert) {
registerSuite({
name: 'PhantomTest',
'dummy': function () {
assert(true, "Works!");
}
});
});
Configuration file root/unit/intern.config.js:
define({
proxyPort: 9000,
proxyUrl: 'http://localhost:9000/',
capabilities: {
'selenium-version': '2.30.0'
},
environments: [
{
browserName: 'phantom'
}
],
maxConcurrency: 3,
useSauceConnect: false,
webdriver: {
host: 'localhost',
port: 4444
},
// used here
loader: {
},
suites: [ 'unit/tests/phantom.js' ],
functionalSuites: [ /* 'myPackage/tests/functional' */ ],
excludeInstrumentation: /^tests\//
});
By running this test and config in a browser it just works.
To run Intern with PhantomJS i execute:
phantomjs --webdriver=4444
And:
cd root
node node_modules\intern\runner.js config=unit/intern.config
The console running Phantomjs then returns:
[INFO - 2013-07-01T21:29:07.253Z] SessionManagerReqHand - _postNewSessionCommand - New Session Created: 42ba5b50-e295-11e2-86f7-e331eb8b922d
While the other one outputs the following message without any further log:
Defaulting to "runner" reporter
Listening on 0.0.0.0:9000
Initialised phantomjs 1.9.1 on windows-7-32bit
Any hint on what i'm missing?
The reason for this is https://github.com/ariya/phantomjs/issues/10522; phantomjs is using an extremely old version of JavaScriptCore that has no Function.prototype.bind. Your best bet at this moment is to switch to using the geezer version of Intern, which should work properly in this older environment.

Categories

Resources