Skip to content

Not able to set the executionContext using Id of iframe #623

@yugal-compro

Description

@yugal-compro

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:

  1. Change the execution context using Id of the iframe
  2. Type 'Yugal Vashishth' inside input
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions