Add Tag to iFrame
To help Test Studio locate your iframes, you can add a custom tag to the iframe. You can then add this tag to the frame properties in your test. There are two ways to add a tag to an iframe:
Add the tag in the HTML for the target page
Add the tag dynamically in a coded step.
Add a Tag to a iframe in HTML
To add a tag to a iframe in your application's HTML, add the 'testStudioTag' attribute to the frame element. For example:
Add a Tag Dynamically in Code
If it is not possible to add custom tags to your iframes, you can add them at runtime using a coded step.
-
Add the following using directive to your code-behind file:
- Call the myFrame() method on the frame object in a coded step. For example:
To tag a nested iframe, ensure the entire DOM is built, so that Test Studio can access the iframes. For example: