This is a migrated thread and some comments may be shown as answers.
IFrame with partial ID
1 Answer 39 Views
This is a migrated thread and some comments may be shown as answers.
Martin
Top achievements
Rank 1
Martin asked on 16 May 2012, 08:16 AM
Hi

How do i switch to an iframe where I only have a partial id?,,  e.g. "[STATIC PART]+Random number"

The partial ID is unique so it's not a problem to use it, I just can't get it working. Tried with WaitForFrame method.

1 Answer, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 17 May 2012, 01:02 PM
Hello Martin,

You need to use a tilde (~) to indicate a partial match based on the static portion of the Frame Id. Here's a sample code against this demo site:
//Find the Frame using partial Id
ArtOfTest.WebAii.Core.Browser myFrame = ActiveBrowser.Frames.ById("~top");
 
//Click on a button inside of the Frame
HtmlInputButton button = myFrame.Find.ByName<HtmlInputButton>("Submit");
button.MouseClick();

Also, check out this article from our User Guide on how to work with Frames and let us know if you need further assistance.

Greetings,
Plamen
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
Asked by
Martin
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Share this question
or