Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Listen to JavaScript events #454

Closed
holtkamp opened this issue Dec 2, 2022 · 2 comments
Closed

Listen to JavaScript events #454

holtkamp opened this issue Dec 2, 2022 · 2 comments
Labels

Comments

@holtkamp
Copy link

holtkamp commented Dec 2, 2022

This might be similar to #444 and #115, but is there (already) a way to listen to JavaScript events?

For example, I am interested in the shown.bs.tab event, fired by a Bootstrap Tab when it has become visible.

I checked the various domains at https://chromedevtools.github.io/devtools-protocol/ but could not find something that worked...

Use Case

  1. open page, content of the first Tab is displayed
  2. click specific Tab, which changes the DOM: the clicked Tab will get the class "active" assigned
  3. select the first heading in the opened Tab, using something like //li[@class="active]//h1

Observations
Clicking the Tab works: when creating screenshot, the content of the clicked Tab is displayed.

However, selecting the first heading in the clicked / active tab fails, the heading on the first Tab is displayed...

So I got the feeling that after clicking the Tab, the DOM is not updated properly, or I am trying to select the first heading too quickly...

Any thoughts / pointers on this?

@enricodias
Copy link
Member

Have you tried the DOM.attributeModified event?

@stale
Copy link

stale bot commented Apr 6, 2023

This issue has been automatically marked as stale because there has been no recent activity. It will be closed after 30 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Apr 6, 2023
@stale stale bot closed this as completed May 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants