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

Iframe

3 Answers 252 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
lupotana
Top achievements
Rank 1
lupotana asked on 18 Sep 2013, 09:42 AM
Good morning,
I must test a site that used ad iFrame... so I don't know how test the redirect of the page.

Is there a guide or hint fot thi ?

Bye,
Marco

3 Answers, 1 is accepted

Sort by
0
Boyan Boev
Telerik team
answered on 18 Sep 2013, 01:28 PM
Hi Marco,

Thank you for trying Test Studio.

You can test iFrames as any other regular html site. The only different thing is whether the iFrame has dynamic url.

Please check out this article in order to get detailed information.

Hope this helps.

Regards,
Boyan Boev
Telerik
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Milton
Top achievements
Rank 1
answered on 14 May 2015, 04:09 AM

<html>
   <head></head>
   <body>
      <iframe id="casesFrame" width="99%" height="418" frameborder="0" src="../cases/main_init" name="casesFrame" style="">
         <html class=" ext-strict x-viewport">
            <head></head>
            <body id="ext-gen3" class=" ext-gecko ext-gecko3 x-border-layout-ct">
               <ul id="ext-gen37" class="x-tree-root-ct x-tree-arrows">
                  <li class="x-tree-node">
                     <a class="x-tree-node-anchor" tabindex="1" href="" hidefocus="on">
                        <span unselectable="on">New case</span>
                     </a>

                  </li>
               </ul>
            </body>
         </html>
      </iframe>
   </body>
</html>

 

I have the following structure in my page, but I get error while performing an event "Click" link "New Case".
I am using the code following in "Test Studio":

Browser casesFrame = Manager.ActiveBrowser.Frames.ById ("casesFrame");
HtmlAnchor NewCase = casesFrame.Find.ByExpression <HtmlAnchor> ("InnerText = ~ New case", "tagname = a");
Assert.IsNotNull (NewCase);
newCase.Click (); //Does not perform the event ​

0
Boyan Boev
Telerik team
answered on 18 May 2015, 08:26 AM
Hello Milton,

You had a lot of white spaces in the code. Also in the last row you had a type. It was newCase.Click however it should be NewCase.Click();

Please try out this code:

Browser casesFrame = Manager.ActiveBrowser.Frames.ById("casesFrame");
HtmlAnchor NewCase = casesFrame.Find.ByExpression<HtmlAnchor>("InnerText=~New case", "tagname=a");
Assert.IsNotNull(NewCase);
NewCase.Click();

Hope this helps.

Regards,
Boyan Boev
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
Tags
General Discussions
Asked by
lupotana
Top achievements
Rank 1
Answers by
Boyan Boev
Telerik team
Milton
Top achievements
Rank 1
Share this question
or