-
Notifications
You must be signed in to change notification settings - Fork 144
Description
Use Case:
I would like to change the execution context using Id of the iframe
I referred to the documentation https://docs.webpagetest.org/scripting/#setexecutioncontext for switching the execution context and was able to switch it using origin but was unable to switch the execution context using the ID of the cross-origin iframe.
Script:
navigate https://codepen.io/juno_okyo/pen/yOjaEZ
setExecutionContext ID=result
execAndWait document.getElementById('name-input').value = 'Yugal Vashishth'
execAndWait document.querySelector('#form > button').click()
Expected Action:
- Change the execution context using Id of the iframe
- Type 'Yugal Vashishth' inside input
- Click 'OK' button
Issue Faced:
The input value is not updating to 'Yugal Vashishth'
This script works fine when I change the execution context using the 'origin' of the iframe but It doesn't work when I use the 'ID' of the iframe.
Note:
I am using ID instead of origin because I have to access two iframes having the same origin, so when I set the execution context using 'origin' it always returns the execution context of the first iframe but I would also like to access the second iframe.