I am using Protractor Page Object model to test a multi-page single-page hybrid web service. The work I am doing is first to register some instructors and students on a non-angular site then login to a different url with each user and do stuff. The IDE I use is Webstorm. The registration part goes well but when it supposed to navigate to the new url in the login function. It threw FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory I have no idea what is happening since the login function works fine in the first few tests (I removed the other test cases for cleanness), any suggestions? Thank you in advance.
Here is my code snippet, should be very straight forward.
describe('saltare registration test', function () {
var url,username = 'xxx',password = 'xxx';
describe('instructor and student registration', function () {
beforeEach(function () {
isAngularSite(false);
url = 'https://prod-cn.saltare.pearson-intl.com/batch_reg/batches/';
common.login(url, username, password);
});
it('instructor register via saltare', function () {
saltare.updateUsers('instructor', 2);
});
});
describe('instructor and student setup', function () {
beforeEach(function () {
isAngularSite(false);
url = 'http://www.myieltslab.com/';
password = 'xxx';
});
it('instructor setup personal profile', function () {
common.login(url, username, password);
}
});
});
});
Here is my login function:
var common = function(){
this.login = function(url, username, password){
console.log('in function login:'+url+' '+username+' '+password);
//browser.driver.nstrong textavigate().to(url);
browser.get(url);
browser.driver.manage().window().maximize();
element(common_objects.USERNAME).sendKeys(username);
element(common_objects.PASSWORD).sendKeys(password);
element(common_objects.SUBMIT).click();
};
}
Here is the console log and the error message
Using the selenium server at http://localhost:4444/wd/hub
[launcher] Running 1 instances of WebDriver
Started
in function:https://prod-cn.saltare.pearson-intl.com/batch_reg/batches/ xxx xxx
in function:https://prod-cn.saltare.pearson-intl.com/batch_reg/batches/ xxx xxx
in function:http://www.myieltslab.com/ xxx xxx
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory
Process finished with exit code -1073740791 (0xC0000409)
Google says that this error is caused by exceeding the default member limit on Node (which is 512mb), due to using large data file? I don't see anything in your code that looks too big (though I'm not sure what isAngularSite(false)
is doing).
I would try just running the last describe and see if that fails on it's own (I'm guessing no). At which point, it's hard to say without seeing the code.
If that fails, try increasing Node's memory limit:
node --max-old-space-size=1024 my-node-script.js
After a few more research, I eventually found the root cause of the error and the solution, which is, for non-angular, if you set ignoreSynchronization off, do not use element()
, use Webdriver's browser.driver.findElement()
instead. This resolves all the issue.
Here is the working code,
var common = function(){
this.login = function(url, username, password){
console.log('in function login:'+url+' '+username+' '+password);
browser.driver.get(url);
browser.driver.manage().window().maximize();
browser.driver.findElement(common_objects.USERNAME).sendKeys(username);
browser.driver.findElement(common_objects.PASSWORD).sendKeys(password);
browser.driver.findElement(common_objects.SUBMIT).click();
};
}
User contributions licensed under CC BY-SA 3.0