Cannot automate webpage with iframes

Work anywhere from any device with Microsoft 365

Upgrade to Microsoft 365 to work anywhere with the latest features and updates.

Upgrade now

Symptom

Web automation actions cannot interact with a web element that is inside a cross-domain iframe. The element may be captured successfully during authoring, however, during runtime we get an error message like “Click link on web page failed”. 

Verifying issue

To verify that the web element is indeed inside a cross-domain iframe, follow the steps below: 

  1. Open the web browser and locate the element 

  2. Press F12 so that the DOM Explorer window of the browser will open 

  3. Select the element through the DOM Explorer  

  4. Within the DOM Explorer window, locate its parent iframe element 

  5. Check the domain that hosts the iframe element 

The domain should be different than that of the webpage.  

Workaround

Open the source webpage of the iframe element on a new tab or a new browser window and continue the automation on the new webpage. 

This procedure can be automated by capturing the embedded webpage’s URL using the “Get details of element on web page” action. The attribute’s value to be captured is the “src” attribute of the iframe element. 

Then use the "Launch new browser" or "Create new tab" action to open the new webpage. 

Note that there are cases where this workaround might not apply, if for example the actions to be performed within the iframe window affect other fields of the parent webpage. 

Need more help?

Expand your skills
Explore Training
Get new features first
Join Microsoft Insiders

Was this information helpful?

Thank you for your feedback!

Thank you for your feedback! It sounds like it might be helpful to connect you to one of our Office support agents.

×