question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Aria queries combined with waitFor* throws unexpected error after page navigation

See original GitHub issue

Steps to reproduce

Tell us about your environment:

What steps will reproduce the problem?

Aria queries companied with waitFor will fail to query any elements after page navigation.

await page.waitForSelector('aria/Button[role="button"]'); // This is fine

await page.reload(); // Or any other page navigation

await page.waitForSelector('aria/Button[role="button"]'); // Cannot find the element anymore 💀 

I’ve put together a minimal repro repo to better demo the issue.

What is the expected result?

It should still successfully get the elements even after page navigation.

What happens instead? It throws timeout error.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
jschfflrcommented, Jan 21, 2021

I can confirm the problem and will investigate!

1reaction
jschfflrcommented, Jan 21, 2021

Ok, so it looks like this boils down to the following problem: v8 checks if a binding has already been installed before. With the current implementation this check returns true even after the reload but the binding will not be there anymore. It seems like there are two possible solutions in this case:

  • Use the undocumented parameter executionContextName for Runtime.addBinding and set it to UTILITY_WORLD_NAME
  • Fix the v8 implementation to either not add the name to the m_activeBindings Set if an executionContextId is set or to remove the name from the set when the execution context is deleted.

@mathiasbynens Let me know what you think would be the best option here!

Read more comments on GitHub >

github_iconTop Results From Across the Web

java - Expected condition failed: waiting for visibility of element ...
This usually happens when you have a loadng overlay placed while page is loading. In such cases selenium cannot find elements after loading ......
Read more >
How To Deal With "Element is not clickable at point” Exception ...
In this blog, we will deal with the "Element is not clickable at point” exception using Selenium.
Read more >
Common mistakes with React Testing Library - Kent C. Dodds
As time has gone on, we've made some small changes to the API and ... does not throw an error if no element...
Read more >
WebDriver - W3C
When asked to wait for navigation to complete , run the following ... If this throws an exception, return error with error code...
Read more >
All other Tokyo fixes - Product Documentation | ServiceNow
The following error is thrown: 'Invalid query detected, stack trace below [Unknown field element in table sys_hub_action_type_base]'.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found