Handing iframes with Telerik Test studio

Handing iframes with TTelerik Testing Framework


Adding content or data to ifrmas is not that hard when using selenium or CoadedUI. All you have to provide is the Xpath of the iframe, but in Telerik test studio its kinda tricky, since it doesn't work with the simple Xpath. 

You always have to record that step and the step fails every time you convert it to a C# code.

SO following is how you handle a iframe in Telerik test studio with C# code

Its advised to use Visual studio when codding with Telerik test studio



1. First create a object/ variable for iframe                                                  
 ArtOfTest.WebAii.Core.Browser t1_frame = ActiveBrowser.Frames[0];  
2. Locate the text editor's Xpath inside the iframe to a another object

  Element TextEditor = t1_frame.Find.ByXPath("/html/body");  


3. Use SetText method and add the description you want
  ActiveBrowser.Actions.SetText(TextEditor, "Description in iframe");  

             


C# code

 ArtOfTest.WebAii.Core.Browser t1_frame = ActiveBrowser.Frames[0];  
 Element TextEditor = t1_frame.Find.ByXPath("/html/body");  
 ActiveBrowser.Actions.SetText(TextEditor, _BlogDescription);  

Comments

Popular posts from this blog

Drag and Drop with Telerik Testing Framework

Sheduling tests - Running Tests From the Command line | Telerik Testing Framework

Using page object model with Telerik Framework