TestProject Forum
Powered by leading experts in the test automation community

Objects not recorded if they are in iFrame

Awesome Amit,

Thanks for the response, It’s just the Microsoft SSO iframe I want to navigate pass so hopefully this will work great for now.

Thank again


Hi @H.Sinclair1,

As Marat explained to you in the chat, this addon will not resolve the login issue on MS website as the problem there is different, it is trying to get out of the contained iFrame and therefore is blocked - that’s why you see an empty screen in the recorder.

I wasn’t aware that this is your use case.

As for the MS SSO, we will investigate it and try to come up with a solution for you.

Kind regards,


I have exactly the same problem with the elements contained in an iFrame.
The switch to iframe works wonderfully. However, is it possible to revert to default content?


Hi @polu,

Are you working with the recorder or with our Java/C# SDK?

A post was split to a new topic: Getting an error when running my test on a Mac agent

With the recorder. I can switch to the iFrame but not go back to the default content.

Hi @polu,

We will have to add the option to return to the default content.
I’ll let you know once it will be available.

Great! Thank you for your quick support.

You’re welcome @polu :slight_smile:

Hi @polu , we released the action to switch to default content and you’re welcomed to try it :slight_smile:
It is a part of Element Extensions addon, the action called “Switch to default content”

1 Like

Thank you @Vladyslav, it works wonderfully!

Hi Polu,
If possible can you please share the screenshots how you achieve this? Was it during recording SwitchToIframe and once enter data in that iFrame and came back to default? Thanks


I have a problem with switching to default content from iFrame. In our web app, we have login window inside the iFrame. After typing all credentials and clicking Submit button, nothing happens (in real user flow it does). I think it is related to executing test inside the iFrame.

After login submission, I tried to add “Switch to default” action and then close the iFrame, however I am getting “Timeout occurred after 15000ms, trying to perform a click: Element was not found”. (Element X closing iFrame is outside the frame.)

Can anybody help me with this issue?

Thanks in advance

Hi @katarzyna.java,

After you complete the login steps and clicking on the Submit button, what should happen? You suppose to stay in the same iframe or move to another one?

Can you share this website with me? I want to try it myself.

Kind regards,

@amit.yahav Thanks for the answer.

Expected result is to log in. In our regular user flow, the iframe closes itself after typying credentials and clicking on submit. User is logged in on main page.

The website is: promo [dot] com
Iframe shows up after clicking on Sign Up or Login buttons in the right side of menu.


Hi @katarzyna.java,

I’ve tried it myself and it’s working as expected. Here’s what you need to do:

  1. Create a new test and navigate to the point where the login iframe element gets open

  2. Create a new element for the login iframe by using this XPath: /html/body/div[16]/div/iframe

  3. Apply the action “Switch to iFrame” on the above element

  4. Create 3 more elements for email, password and the submit button.

  5. The next action, right after the click, would be "Switch to default content"

I’ve tried it my self and it did get me to this page where I can spy the element inside of it:

Please let me know if you’ll need my help with that :slight_smile:

1 Like

Thank you so much!
You are right - login feature works correctly.
Unfortunately during Sign Up flow still nothing happens - I mean after clicking on Submit button and switching to default.

Hi @katarzyna.java,

Can you please check if the content that’s displayed after clicking on the Submit button for the registration, is an iframe too?

Perhaps you will have to switch to another iframe

I think I tried everything :frowning: with no luck.
In login flow, it works. In signup flow, not.
There is no other iframe.