I am having a problem where my Protractor tests always exit with an error message:
UnknownError: Error Message => '[ng:btstrpd] App Already Bootstrapped with this Element '<html lang="en" data-ng-app="pmApp" class="js draganddrop no-video no-audio ng-scope">'
Current Angularjs docs point out that the problem is that the application manually loads, whereas in my case it is not, we just use:
<html lang="en" data-ng-app="pmApp">
A normal site works fine, without errors or warnings, but as soon as I installed my tests using Protractor, an error occurs. Note that the test passed when I used angularjs 1.08, but has not been able to use 1.25 since then
The test looks like this:
describe('Campaigns page', function() {
var ptor;
beforeEach(function() {
browser.driver.manage().window().setSize(1200, 800);
ptor = protractor.getInstance();
browser.driver.get(ptor.baseUrl + '/login');
browser.driver.findElement(by.id('user_email')).sendKeys('admin@aperture.*************.com');
browser.driver.findElement(by.id('user_password')).sendKeys('*************');
browser.driver.findElement(by.css('.button.primary')).click();
browser.driver.wait(function() {
return browser.driver.getCurrentUrl().then(function(url) {
return (/\/#\/$/.test(url));
});
});
browser.get('#/');
});
it('Should list campaigns on the page', function() {
browser.get('#/campaigns');
browser.findElements(by.css('.main-campaign')).then(function(results) {
expect(results.length).toBeGreaterThan(0);
});
});
});
* Pay attention to the actual login details deleted for security.
Once: browser.get ('# / campaigns');
an error occurs.
onPrepare confractor conf, .
!
:
Stacktrace:
UnknownError: Error Message => '[ng:btstrpd] App Already Bootstrapped with this Element '<html lang="en" data-ng-app="pmApp" class="js draganddrop no-video no-audio ng-scope">'
http://errors.angularjs.org/1.2.5/ng/btstrpd?p0=%3Chtml%20lang%3D%22en%22%20data-ng-app%3D%22pmApp%22%20class%3D%22js%20draganddrop%20no-video%20no-audio%20ng-scope%22%3E '
Request = > { "headers": { "Accept": "application/json, image/png", "Connection": "Keep-Alive", "Content-Length": "159", "Content-Type": "application/json; charset = utf-8", "Host": "localhost: 29064" }, "httpVersion": "1.1", "method": "POST", "post": "{\" args\ ": [[]], \" script\ ": \" return (function() {\n// Angular.\n Angular.resumeBootstrap(arguments [0]);\n }). apply (null, arguments);\ "}", "url": "/execute", "urlParsed": { "anchor": "," query": "," file ":" execute "" ":" / "," ":" / "," ":" / "," ": "," ": "," ":" "," ":"," USERINFO": "," ": "," ": "," ":" / "," queryKey ": {}," ": [" "]}," urlOriginal ":" //64b440e0-68b9-11e3-b92a-e1efe36914bc/"}
: : '2.37.0', : 'a7c61cb', : '2013-10-18 17:14:00'
: host: 'peters-mbp', ip: '192.168.0.3', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.9 ', java.version:' 1.6.0_65