Protractor: Safari browser is not able to detect angular JS Application.

Created on 8 Oct 2018  路  5Comments  路  Source: angular/protractor

Hi,
When i am trying to execute protractor script using safari browser for angular JS Application,
then I am getting below error but same is working with firefox and chrome.

Environment: MAC OS Siera
Browser: Safari 11.1.1
Protractor : Version 5.4.1
Node : v8.12.0

spec.js

/**


  • */
    describe('angularjs homepage todo list', function() {
    it('should add a todo', function() {
    browser.get('https://angularjs.org');
    element(by.model('todoList.todoText')).sendKeys('write first protractor test');
    element(by.css('[value="add"]')).click();
var todoList = element.all(by.repeater('todo in todoList.todos'));
expect(todoList.count()).toEqual(3);
expect(todoList.get(2).getText()).toEqual('write first protractor test');

// You wrote your first test, cross it off the list
todoList.get(2).element(by.css('input')).click();
var completedAmount = element.all(by.css('.done-true'));
expect(completedAmount.count()).toEqual(2);

});

});

conf.js

/**


  • */
    exports.config = {
    seleniumAddress: 'http://localhost:4444/wd/hub',
    specs: ['spec.js'],
    capabilities: {
    'browserName': 'safari'
    }
    };

Console output:

[08:54:12] I/launcher - Running 1 instances of WebDriver
[08:54:12] I/hosted - Using the selenium server at http://localhost:4444/wd/hub
Started
[08:54:25] E/protractor - Could not find Angular on page https://angularjs.org/ : angular never provided resumeBootstrap
F

Failures:
1) angularjs homepage todo list should add a todo
Message:
 Failed: Angular could not be found on the page https://angularjs.org/. If this is not an Angular application, you may need to turn off waiting for Angular.
Please see
https://github.com/angular/protractor/blob/master/docs/timeouts.md#waiting-for-angular-on-page-load
Stack:
Error: Angular could not be found on the page https://angularjs.org/. If this is not an Angular application, you may need to turn off waiting for Angular.
Please see
https://github.com/angular/protractor/blob/master/docs/timeouts.md#waiting-for-angular-on-page-load
at executeAsyncScript_.then (/Users/azhar/Documents/Workspace_protractor/freeCRM_Protractor/protractor/built/browser.js:720:27)
at ManagedPromise.invokeCallback_ (/Users/azhar/Documents/Workspace_protractor/freeCRM_Protractor/protractor/node_modules/selenium-webdriver/lib/promise.js:1376:14)
at TaskQueue.execute_ (/Users/azhar/Documents/Workspace_protractor/freeCRM_Protractor/protractor/node_modules/selenium-webdriver/lib/promise.js:3084:14)
at TaskQueue.executeNext_ (/Users/azhar/Documents/Workspace_protractor/freeCRM_Protractor/protractor/node_modules/selenium-webdriver/lib/promise.js:3067:27)
at asyncRun (/Users/azhar/Documents/Workspace_protractor/freeCRM_Protractor/protractor/node_modules/selenium-webdriver/lib/promise.js:2927:27)
at /Users/azhar/Documents/Workspace_protractor/freeCRM_Protractor/protractor/node_modules/selenium-webdriver/lib/promise.js:668:7
at
at process._tickCallback (internal/process/next_tick.js:189:7)
From: Task: Run it("should add a todo") in control flow
at UserContext. (/Users/azhar/Documents/Workspace_protractor/freeCRM_Protractor/protractor/node_modules/jasminewd2/index.js:94:19)
From asynchronous test:
Error
at Suite. (/Users/azhar/Documents/Workspace_protractor/freeCRM_Protractor/spec1.js:5:3)
at Object. (/Users/azhar/Documents/Workspace_protractor/freeCRM_Protractor/spec1.js:4:1)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)

1 spec, 1 failure
Finished in 10.431 seconds

[08:54:25] I/launcher - 0 instance(s) of WebDriver still running
[08:54:25] I/launcher - safari #01 failed 1 test(s)
[08:54:25] I/launcher - overall: 1 failed spec(s)
[08:54:25] E/launcher - Process exited with error code 1

Most helpful comment

Seeing this too. Can we please get some love here?

All 5 comments

But when I am making changes in spec.js file as browser.waitForAngularEnabled(false) then its working as expected but "https://angularjs.org" is an angular js application and why its behaving differently as its working in chrome and firefox without any issue.
/**


  • */
    describe('angularjs homepage todo list', function() {
    it('should add a todo', function() {
    browser.waitForAngularEnabled(false);
    browser.get('https://angularjs.org');
element(by.model('todoList.todoText')).sendKeys('write first protractor test');
element(by.css('[value="add"]')).click();

var todoList = element.all(by.repeater('todo in todoList.todos'));
expect(todoList.count()).toEqual(3);

// expect(todoList.get(2).getText()).toEqual('write first protractor test');

// You wrote your first test, cross it off the list
todoList.get(2).element(by.css('input')).click();
var completedAmount = element.all(by.css('.done-true'));
expect(completedAmount.count()).toEqual(2);

});

});

Seeing this too. Can we please get some love here?

Any fix for this I'm seeing it in Safari 12.1.2

Same here for Safari 13.0.3

Have anyone found a solution?

@sjelin @juliemr: Do you have any hint here?

Was this page helpful?
0 / 5 - 0 ratings