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

Not able to reset executionContext #616

Open
manpreet-compro opened this issue May 17, 2023 · 1 comment
Open

Not able to reset executionContext #616

manpreet-compro opened this issue May 17, 2023 · 1 comment

Comments

@manpreet-compro
Copy link

Use Case:
Perform some action in the iframe and then some action on main document

I referred the documentation https://docs.webpagetest.org/scripting/#setexecutioncontext for switching the execution context and followed the example code

Script:

navigate https://codepen.io/juno_okyo/pen/yOjaEZ
setExecutionContext origin=https://cdpn.io
execAndWait document.getElementById('name-input').value = 'Bob';
execAndWait document.querySelector('button').click();
sleep 2
setExecutionContext
clickAndWait data-test-id=login-button
sleep 10

Expected Action:

  1. Set execution context to of iframe
  2. Type Bob in the input field
  3. Click 'OK' button
  4. Set execution context to main document
  5. Click on 'Login' button in the header

Error Faced
No action captured after resetting the execution context. Results can be referred from https://www.webpagetest.org/result/230517_AiDcJ3_9W6/

Step 4 is not captured at all and there is no data

@pmeenan
Copy link
Contributor

pmeenan commented May 18, 2023

The in-flight PR should fix the resetting of the execution context. Not sure if it will solve all of the issues (i.e. a sleep 10 after a script step won't cause it to wait 10 seconds for that step to be recorded, it's just a pause before the next step).

jefflembeck pushed a commit that referenced this issue Jul 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants