You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 29, 2024. It is now read-only.
Scenario:
Click on an element
A route is loaded using $location
The $routeChangeSuccess event is fired
Its eventhandler loads the contents of the page using an $http call
Error:
Index out of bound. Trying to access element at index:0, but there are only 0 elements
Expected outcome:
No error, but a future containing the text of the elemement
If my expectation is correct and this is not a known bug I can provide a code example.
I debugged this using notifyWhenNoOutstandingRequests to log on the console when angular was ready. And other console.log calls when the $http call was made and finished.
My output looks like this:
Angular ready
Starting $http call
Call finished
The expected output is:
Starting $http call
Call finished
Angular ready
I am running protractor 1.4.0 and I'm currently refactoring my code to upgrade to 1.5. I might have similar issues where the view loaded by ng-route only contains ng-if logic. Protractor is supposed to also wait for this I suppose. I am currently investigating this further, to determine if protractor is also not waiting for this logic.
The text was updated successfully, but these errors were encountered:
Since this issue was marked as needs: investigation I created a minimal application to reproduce the issue. It is available here. See the readme there to reproduce the issue.
Actually, doesn't seem like this is a problem anymore. I mapped out all the $apply and $digest cycles around route changes, and even with slowly loading templates protractor consistently does the right thing.
Note that given app is not a valid test - it waits for outstanding requests synchronously, but protractor does all of its waiting asynchronously in webdriver callbacks. However, there is a PR for angular that fixes this issue.
I disagree that the given app is not a valid test. The main feature of protractor is that you can write your test synchronously and protractor will wait for angular. Or do you mean something else @mgiambalvo?
@0xR The thing about that app is that it's using testability directly, not via Protractor. When Protractor calls whenStable it will be executing the code via WebDriver's executeScript command, which always runs asynchronously.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Scenario:
Click on an element
A route is loaded using $location
The $routeChangeSuccess event is fired
Its eventhandler loads the contents of the page using an $http call
Protractor code:
element(...).click()
element(...).first().getText()
Error:
Index out of bound. Trying to access element at index:0, but there are only 0 elements
Expected outcome:
No error, but a future containing the text of the elemement
If my expectation is correct and this is not a known bug I can provide a code example.
I debugged this using notifyWhenNoOutstandingRequests to log on the console when angular was ready. And other console.log calls when the $http call was made and finished.
My output looks like this:
Angular ready
Starting $http call
Call finished
The expected output is:
Starting $http call
Call finished
Angular ready
I am running protractor 1.4.0 and I'm currently refactoring my code to upgrade to 1.5. I might have similar issues where the view loaded by ng-route only contains ng-if logic. Protractor is supposed to also wait for this I suppose. I am currently investigating this further, to determine if protractor is also not waiting for this logic.
The text was updated successfully, but these errors were encountered: