Only first page elements can be found with selectors in Ionic 3
See original GitHub issueBug report Hi!
In Ionic3, I can normally find the HTML elements with ‘$’ selector like: $('#start-game')
, but when I start the game, which leads me to the next Page (executed with nav.setRoot or nav.push), then it doesn’t find me any HTML elements anymore, but I get the error instead (provided below).
I already tried to set some browser.wait on hundred ways but nothing helps.
- Node Version:
6.10.2
- Protractor Version:
5.1.2
- Angular Version:
4.1.0
- Browser(s):
Chrome
- Operating System and Version
Win 10
- Your protractor configuration file: https://pastebin.com/1g7j4Ekf
- A relevant example test
const goalWrapper = $('#goal-wrapper');
const until = protractor.ExpectedConditions;
browser.wait(until.presenceOf(goalWrapper), 5000, 'Element taking too long to appear in the DOM');
$('#goal-wrapper').getSize().then((size) => { // this is not executed! console.log(size); });
- Output from running the test
- Failed: Timed out waiting for asynchronous Angular tasks to finish after 11 seconds. This may be because the current page is not an Angular application. Please see the FAQ for more details: https://github.com/angular/protractor/blob/master/docs/timeouts.md#waiting-for-angular While waiting for element with locator - Locator: By(css selector, .level-complete-wrapper)
- Steps to reproduce the bug: Try the code above.
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
Ionic Demo: UI Components & API Customization to Create ...
If your page has an <ion-navbar> , a back button will automatically be added to it if it is not a root page,...
Read more >ionic 5 component selector is not applied to html element
It is inserted as one of the top level html elements on the page, so it can be used in the css styles...
Read more >Using Custom Components on Multiple Pages in Ionic
In this tutorial, we take a look at some common pitfalls when using custom components and how you can use custom components across...
Read more >overscroll-behavior - CSS: Cascading Style Sheets | MDN
Default scroll overflow behavior is observed inside the element this value is set on (e.g. "bounce" effects or refreshes), but no scroll ...
Read more >The 30 CSS Selectors You Must Memorize - Code
This snippet is an abstraction that will find all paragraphs on the page, and then sub-target only the first letter of that element....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ok,
I’m going to close this issue for now. It’s still open for discussion.
I see, it was too late to think clearly 😄 The thing is that I had more examples but they were calling the same thing “getSize”, so I can simply change the selector. Let’s say thisi is now relevant test example: