Skip to content
This repository has been archived by the owner on Jul 29, 2024. It is now read-only.

Safari browser is not able to detect angular JS Application. #4971

Open
azharuddinkhan1986 opened this issue Oct 8, 2018 · 5 comments
Open

Comments

@azharuddinkhan1986
Copy link

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
�[31mF�[0m

Failures:

  1. angularjs homepage todo list should add a todo
    Message:
    �[31m 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�[0m
    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 #1 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

@azharuddinkhan1986
Copy link
Author

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

});

});

@GuyMograbi
Copy link

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

@dlangston
Copy link

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

@Gordiievskyi
Copy link

Same here for Safari 13.0.3

@evilaliv3
Copy link
Contributor

Have anyone found a solution?

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

evilaliv3 added a commit to globaleaks/globaleaks-whistleblowing-software that referenced this issue Jun 5, 2020
evilaliv3 added a commit to globaleaks/globaleaks-whistleblowing-software that referenced this issue Jun 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants