This is a migrated thread and some comments may be shown as answers.

IFrames and Silverlight elements

1 Answer 79 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
algot
Top achievements
Rank 1
algot asked on 29 Oct 2012, 05:56 PM
I want to create coded steps to handle Silverlight elements.
I created following code
SilverlightApp app = ActiveBrowser.SilverlightApps()[0];
But my code can't connect to Silverlight application.
As I understand this is because I have Silverlight application wrapped into iframe.
<DIV style="DISPLAY: none" id=IFRAME_MainDetails_c class="ms-crm-FieldLabel-LeftAlign ms-crm-Field-Normal" sl="false"><LABEL for=IFRAME_MainDetails>MainDetails</LABEL></DIV>
<IFRAME style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; BORDER-TOP: 0px; BORDER-RIGHT: 0px" id=IFRAME_MainDetails class=ms-crm-Custom tabIndex=1020 src="/TempTestHandover/%7B634871220200000000%7D/WebResources/sitecore_/KpiReports/QualificationRecordMainDetails.html" frameBorder=0 scrolling=no preload="0" url="../webresources/sitecore_ClearBackgroundPage.htm"></IFRAME>

Please provide example of code how could I define IFrame element and then define inner Silverlight application in it.

1 Answer, 1 is accepted

Sort by
0
Cody
Telerik team
answered on 02 Nov 2012, 04:08 AM
Hi Alexander,

I apologize for the delay getting back to you on this.

When you know the correct index of everything you can use code like this to get to your Silverlight application:
SilverlightApp app = ActiveBrowser.Frames[0].SilverlightApps()[0];

If the you are not certain of the correct frame index, or want to account for a variable index, you can tell Test Studio to search for the frame using a FrameInfo like this:
SilverlightApp app2 = ActiveBrowser.Frames[new FrameInfo("IFRAME_MainDetails", "", "/TempTestHandover/%7B634871220200000000%7D/WebResources/sitecore_/KpiReports/QualificationRecordMainDetails.html", 0)].SilverlightApps()[0];

Kind regards,
Cody
the Telerik team
Are you enjoying Test Studio? We’d appreciate your vote in the ATI automation awards.
Vote now
Tags
General Discussions
Asked by
algot
Top achievements
Rank 1
Answers by
Cody
Telerik team
Share this question
or