all
I can run spookyjs program without a problem.
However, if it runs over long period of time, e.g. 24 hours or 48 hours, continuously the program stops with this message. Anyone got a clue for this error?
It could be other environment issue as spookyjs log seems fine.
{ [Error: Child terminated with non-zero exit code 3221225477]
details: { code: 3221225477, signal: null } }
Setting:
var spooky = new Spooky({
child: {
transport: 'http'
},
casper: {
logLevel: 'debug',
verbose: true,
"ssl-protocol": "any", //added for phantomjs ssl-protocol error
clientScripts: [
'../lib/jquery-2.2.3.min.js',
]
},
child: {
port: 10010,
bufferSize: 32 * 1024 // 32KB
}
}
...
My working environments:
node: v0.12.4
casperjs: 1.1.0-beta5
phantomjs: 1.9.7
npm: 2.10.1
os: windows 10
Related
We have a secured network and Protractor test suite runs locally. But when running the Gitlab CI/CD pipeline with headless chrome it returns network errors
This is my conf.js
exports.config = {
framework : "jasmine2",
multiCapabilities : [
{
browserName: "chrome",
chromeOptions: {
args: [
"--incognito",
"--headless",
"--no-sandbox",
"--disable-gpu",
"--window-size=1920,1080",
"--disable-dev-shm-usage",
"--allow-insecure-localhost"
],
},
},
],
specs: [
'./tests/sample.ts',
],
seleniumServerJar: '../node_modules/protractor/node_modules/webdriver-manager/selenium/selenium-server-standalone-3.141.59.jar',
seleniumAddress: 'http://localhost:4444/wd/hub',
chromeDriver: './node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_98.0.4758.102',
directConnect: true,
onPrepare: function(){
void browser.manage().timeouts().implicitlyWait(10000);
void browser.waitForAngularEnabled(false);
require("ts-node").register({
project: require("path").join(__dirname, "./tsconfig.json"),
})
},
plugins: [{
package: 'protractor-screenshoter-plugin',
screenshotPath: './outputJS/reports/e2e',
screenshotOnExpect: 'failure+success',
takeScreenshots:'true',
withLogs: 'true',
writeReportFreq: 'asap',
imageToAscii: 'none',
clearFoldersBeforeTest: true
}]
}
Error appears
$ npm run e2e-headless-run
> e2e#1.0.0 e2e-headless-run /var/gitlab-runner/-8xgu1of/0/team-iron/ebba/pco-front-end/e2e
> node node_modules/protractor/bin/protractor ./headless_conf.js
[09:46:36] W/driverProviders - Using driver provider directConnect, but also found extra driver provider parameter(s): seleniumAddress, seleniumServerJar
[09:46:37] I/launcher - Running 1 instances of WebDriver
[09:46:37] I/direct - Using ChromeDriver directly...
Activated Protractor Screenshoter Plugin, ver. 0.10.3 (c) 2016 - 2022 [object Object] and contributors
Started
Creating reporter at ./outputJS/reports/e2e/
FF
Failures:
1) Google Sample Test loading web page
Message:
Expected '**Network Error**' to contain 'PCO'.
Stack:
Error: Failed expectation
at helper.verifyPageTitle (/var/gitlab-runner/-8xgu1of/0/team-iron/ebba/pco-front-end/e2e/helper/helper.ts:151:36)
at loginPage.verify_page_title (/var/gitlab-runner/-8xgu1of/0/team-iron/ebba/pco-front-end/e2e/pages/loginpage.ts:55:23)
I tried adding webDriverProxy and proxy. But same result appears.
I am trying to execute my tests in nodejs using protractor.
Example protractor protractor.conf
When I run protractor protractor.conf, I get error Error code 135, Error message Could not fingd update-config.json. Run webdriver-manager update to download the binaries
I ran the following command but still get the above error message
webdriver-manager update -- proxy http://
protractor.conf.js
/*global jasmine */
var SpecReporter = require('jasmine-spec-reporter');
var TfsReporter = require('jasmine-tfs-reporter');
exports.config = {
allScriptsTimeout: 11000,
specs: [
'./src/tests/*spec.js'
],
capabilities: {
'browserName': 'chrome',
/*'browserName': 'phantomjs',
'phantomjs.binary.path': require('phantomjs-prebuilt').path,
'phantomjs.ghostdriver.cli.args': ['--loglevel=DEBUG']*/
},
directConnect: true,
baseUrl: 'http://localhost:4200/',
framework: 'jasmine',
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000,
print: function() {}
},
useAllAngular2AppRoots: false,
beforeLaunch: function() {
require('ts-node').register({
project: '../PartyAndIndustryDataMigration'
});
},
onPrepare: function() {
jasmine.getEnv().addReporter(new SpecReporter());
jasmine.getEnv().addReporter(new TfsReporter());
}
};
I'm not 100% sure (and cannot it check now), but shouldn't command look like that:
webdriver-manager update --proxy http:// (without space between -- and proxy)?
I guess chrome driver & update-config.json couldn't downloaded at the time of webdriver-manager update.
Just for verification go to
node_modules\protractor\node_modules\webdriver-manager\selenium\
location and look if everything downloaded properly?
If there is problem on downloading chrome driver you can check chrome-response.xml in same location for reason. One reason could be chrome driver website is in blacklisted or behind the proxy.
1.Open Command prompt or terminal.
2.Go to your project root directory.
3.Enter the below command and hit Enter key.
node node_modules/protractor/bin/webdriver-manager update
This command will update the WebDriver Manager.
I am running an WebDriver.io test using gulp-wdio npm pakage
on selenium-standalone
The Code that I run in gulp is:
gulp.task('e2e', function () {
return gulp.src('wdio.conf.js')
.pipe(wdio({
wdio: {
specs: './test/features/**/*.feature'
}
}));
});
And my wdio.conf.js define browsers this way:
capabilities: [
{
browserName: 'internet explorer',
version: 'ANY'
}
],
How ever the typing is very slow, i had found on the internet that running 32 bit version of the web-driver resolves the issue, how ever I can't find how to configure the capabilities or some other place to run the IE32 bit driver by default...
Any help will be appreciated #:-)
After 2 days of research I had found the solution !!!
There is a configuration file that need to be supplied to the selenium standalone
as shown in this Example
so our final setup is done in this way:
We have a configuration file called wdio.browsers.setup.js that contains the browsers setup:
module.exports = {
baseURL: 'https://selenium-release.storage.googleapis.com',
version: '3.3.1',
drivers: {
chrome: {
version: '2.29',
arch: process.arch,
// - Recent versions of the driver: https://sites.google.com/a/chromium.org/chromedriver/
baseURL: 'https://chromedriver.storage.googleapis.com'
},
ie: {
version: '3.0.0',
arch: 'ia32',
// - Recent versions of the driver: http://selenium-release.storage.googleapis.com/index.html
baseURL: 'https://selenium-release.storage.googleapis.com'
},
firefox: {
version: '0.15.0',
arch: process.arch,
baseURL: 'https://github.com/mozilla/geckodriver/releases/download'
}
}
};
and then inside wdio.conf.js we load it and assign to a special parameters
let browsersSetup = require('./wdio.browsers.setup');
exports.config = {
seleniumArgs: browsersSetup,
seleniumInstallArgs: browsersSetup,
After that all is working fine #:-)
Note: if you have your web-driver installed globally remove the global setup first it's located in:
C:\Users\%USERNAME%\AppData\Roaming\npm
Then you can run the local installation using:
./node_modules/.bin/selenium-standalone install --config=../../wdio.browsers.setup.js
Please find the below working solution for IE browser to install 32 bit:
services: ["selenium-standalone"],
seleniumArgs: {
drivers: {`enter code here`
ie: {
version: "3.4.0", // or whatever latest is
arch: "ia32", // forces use of 32 bit driver
baseURL: "https://selenium-release.storage.googleapis.com"
},
},
},
seleniumInstallArgs: {
drivers: {
ie: {
version: "3.4.0", // or whatever latest is
arch: "ia32", // forces use of 32 bit driver
baseURL: "https://selenium-release.storage.googleapis.com"
},
},
},
I have windows 10 laptop. My problem is that after i run the conf.js file, browser is opening but not conneting to the test url. giving below error message.
C:\Users\acer\AppData\Roaming\npm\node_modules\protractor\FFAutomation>C:\Users\acer\AppData\Roaming\npm\protractor conf.js
Report destination: target\screenshots\Report.html
[15:59:26] I/direct - Using FirefoxDriver directly...
[15:59:26] I/launcher - Running 1 instances of WebDriver
[16:00:15] E/launcher - Timed out waiting for the WebDriver server at http://127.0.0.1:55402/hub
[16:00:15] E/launcher - Error: Timed out waiting for the WebDriver server at http://127.0.0.1:55402/hubat Error (native)
And lastly [16:00:15] E/launcher - Process exited with error code 199
enter code here
The conf.js file is given below:
var HtmlScreenshotReporter = require('protractor-jasmine2-screenshot-reporter');
var reporter = new HtmlScreenshotReporter({
dest: 'target/screenshots',
filename: 'Report.html',
reportTitle: 'Execution Report',
showSummary: true,
showQuickLinks: true,
pathBuilder: function(currentSpec, suites, browserCapabilities) {
// will return chrome/your-spec-name.png
return browserCapabilities.get('browserName') + '/' + currentSpec.fullName;
}
});
exports.config = {
directConnect: true,
//seleniumAddress: 'http://localhost:4444/wd/hub',
capabilities: {'browserName': 'firefox'},
// multiCapabilities: [
// {
// browserName: 'firefox'
// },
// {
// browserName: 'chrome'
// }
// ],
framework: 'jasmine',
specs: ['Login_spec3.js'],
//'Login_spec2.js','Article_spec.js','Catalog_spec.js', ' 'LoginwithTD_spec2.js', 'Login_spec3copy.js','Setting_spec.js'
allScriptsTimeout: 300000,
getPageTimeout: 300000,
jasmineNodeOpts: {
defaultTimeoutInterval: 300000
},
// Setup the report before any tests start
beforeLaunch: function() {
return new Promise(function(resolve){
reporter.beforeLaunch(resolve);
});
},
// Close the report after all tests finish
afterLaunch: function(exitCode) {
return new Promise(function(resolve){
reporter.afterLaunch(resolve.bind(this, exitCode));
});
},
onPrepare: function() {
var width = 1300;
var height = 1200;
browser.driver.manage().window().setSize(width,height);
jasmine.getEnv().addReporter(reporter);
afterAll(function(done) {
process.nextTick(done);
})
//browser.params.users = require('./shared.params.' + countryCode + '.json').users;
}
};
*I have copied some scripts(which is executable on her macbook) from a friend and paste it in a folderin window 10 pc named FFAutomation path. C:\Users\acer\AppData\Roaming\npm\node_modules\protractor\FFAutomation
1)I have update the chrome driver to version 2.24 chromedriver_win32 , update the chrome driver with command "webdriver-manager update" and run the webdriver with command "webdriver-manager start".
2) Than i run conf.js file on another terminal with the firefox browser
C:\Users\acer\AppData\Roaming\npm\node_modules\protractor\FFAutomation>C:\Users\ acer\AppData\Roaming\npm\protractor conf.js
I am getting this following error
Report destination: target\screenshots\Report.html
[15:59:26] I/direct - Using FirefoxDriver directly...
[15:59:26] I/launcher - Running 1 instances of WebDriver
[16:00:15] E/launcher - Timed out waiting for the WebDriver server at http://127.0.0.1:55402/hub
[16:00:15] E/launcher - Error: Timed out waiting for the WebDriver server at http://127.0.0.1:55402/hubat Error (native)
And lastly [16:00:15] E/launcher - Process exited with error code 199
enter code here
3) Than i run conf.js file on another terminal with the "chrome" browser
C:\Users\acer\AppData\Roaming\npm\node_modules\protractor\FFAutomation>C:\Users\ acer\AppData\Roaming\npm\protractor conf.js
I am getting this following error
Error: Error: Cannot find module '/Users/rohitgathibandhe/npm- global/lib/node_modules/protractor/FFAutomation/Function_Lib.js'
E/launcher - Process exited with error code 100
Run webdriver-manager start before executing your tests.
i would like to use gulp-sitespeedio#0.0.8 to test my website with webpagetest.
But I get an error on my console and I dont know why. Find anybody my fault?
[20:16:26] Starting 'webpagetest:build'...
[20:16:26] Analyze your site’s web performance
info: OS: 'darwin 15.6.0', Node.js: 'v5.1.0', sitespeed.io: '3.5.0', PhantomJS: '1.9.8', java: '1.8.0_31', browsertime: '0.9.4'
info: Using configured web perf budget {"wpt":{"requests":60,"bytesIn":1000000,"SpeedIndex":1000}}
info: Will analyze 2 pages
info: Running WebPageTest http://www.sitespeed.io pollResults=10, timeout=800, firstViewOnly=false, runs=9, private=true, aftRenderingTime=true, location=Dulles:Firefox, connectivity=3G, video=true
info: Running WebPageTest http://www.sitespeed.io/faq/ pollResults=10, timeout=800, firstViewOnly=false, runs=9, private=true, aftRenderingTime=true, location=Dulles:Firefox, connectivity=3G, video=true
error: WebPageTest couldn't fetch info for url http://www.sitespeed.io{ [WPTAPIError: Moved Permanently] name: 'WPTAPIError', code: 301, message: 'Moved Permanently' }
error: Error running WebPageTest: { [WPTAPIError: Moved Permanently] name: 'WPTAPIError', code: 301, message: 'Moved Permanently' }
error: WebPageTest couldn't fetch info for url http://www.sitespeed.io/faq/{ [WPTAPIError: Moved Permanently] name: 'WPTAPIError', code: 301, message: 'Moved Permanently' }
error: Error running WebPageTest: { [WPTAPIError: Moved Permanently] name: 'WPTAPIError', code: 301, message: 'Moved Permanently' }
/Users/.../node_modules/sitespeed.io/lib/util/util.js:279
return pageData.webpagetest.wpt[0].response.data.testUrl;
^
TypeError: Cannot read property 'response' of undefined
at Object.module.exports.getURLFromPageData (/Users/.../node_modules/sitespeed.io/lib/util/util.js:279:43)
at Object.exports.processPage (/Users/.../node_modules/sitespeed.io/lib/collectors/assetsByTiming.js:25:21)
at /Users/.../node_modules/sitespeed.io/lib/collector.js:126:7
at Array.forEach (native)
at Collector.collectPageData (/Users/.../node_modules/sitespeed.io/lib/collector.js:125:19)
at processAnalysisResults (/Users/.../node_modules/sitespeed.io/lib/analyze/analyzer.js:171:14)
at /Users/.../node_modules/sitespeed.io/lib/analyze/analyzer.js:68:7
at /Users/.../node_modules/async/lib/async.js:254:17
at /Users/.../node_modules/async/lib/async.js:157:25
at /Users/.../node_modules/async/lib/async.js:251:21
at Object.queue.drain (/Users/.../node_modules/sitespeed.io/lib/analyze/webpagetest.js:63:11)
at next (/Users/.../node_modules/async/lib/async.js:804:31)
at /Users/.../node_modules/async/lib/async.js:32:16
at /Users/.../node_modules/sitespeed.io/lib/analyze/webpagetest.js:127:14
at WebPageTest.testCallback (/Users/.../node_modules/webpagetest/lib/webpagetest.js:346:14)
at callbackYield (/Users/.../node_modules/webpagetest/lib/webpagetest.js:138:14)
And here is my configuration. It is exact your example.
var gulp = require( "gulp" ),
sitespeedio = require( "gulp-sitespeedio" );
gulp.task( "webpagetest:build", sitespeedio( {
urls: ["http://www.sitespeed.io", "http://www.sitespeed.io/faq/"],
noYslow: true,
wptKey: "SECRET_KEY",
wptHost: "www.webpagetest.org",
no: 9,
wptConfig: {
location: "Dulles:Firefox",
connectivity: "3G",
timeout: 800
},
budget: {
wpt: {
requests: 60,
bytesIn: 1000000,
SpeedIndex: 1000
}
}
} ) );
node-version: v5.1.0
npm-version: v3.3.12
gulp-version: CLI v3.9.0 // LOCAL 3.9.1
Thanks for any help...
The wptHost should use a https connection:
wptHost: "https://www.webpagetest.org/"