﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-qileilove-文章分类-HOLMOS</title><link>http://www.blogjava.net/qileilove/category/54355.html</link><description>不想做屌丝的码农，不是好项目经理！屌丝生涯从此开始！</description><language>zh-cn</language><lastBuildDate>Mon, 12 May 2014 08:43:21 GMT</lastBuildDate><pubDate>Mon, 12 May 2014 08:43:21 GMT</pubDate><ttl>60</ttl><item><title> Holmos自动化测试入门学习(四）---------------iFrame里面元素的定位</title><link>http://www.blogjava.net/qileilove/articles/413563.html</link><dc:creator>顺其自然EVO</dc:creator><author>顺其自然EVO</author><pubDate>Mon, 12 May 2014 08:09:00 GMT</pubDate><guid>http://www.blogjava.net/qileilove/articles/413563.html</guid><wfw:comment>http://www.blogjava.net/qileilove/comments/413563.html</wfw:comment><comments>http://www.blogjava.net/qileilove/articles/413563.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/qileilove/comments/commentRss/413563.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/qileilove/services/trackbacks/413563.html</trackback:ping><description><![CDATA[<div id="article_details" style="margin: 20px; font-family: Arial, Console, Verdana, 'Courier New'; font-size: 13.333333969116211px; line-height: normal;"><div id="article_content" style="margin: 20px 0px 0px; font-size: 14px; line-height: 26px; font-family: Arial;">&nbsp;iFrame 定位的思想是先定位到iFrame，再定位iFrame里面的元素。<div></div><div>常用到的3个方法：</div><div>select()--------------------------选取要操作的frame</div><div><div>selectParentContainer() &nbsp;------这个是回到上一层frame的&nbsp;</div><div>selectTopPage() ----------------这个是回到顶部页面</div>&nbsp;</div><div></div><div>具体例子：</div><div>1.新建2个html 页面,放于D盘，作为被测试的页面</div><div>main.html</div><div align="left"><div bg_html"="" style="width: 936.3368530273438px;"><div><div><strong>[html]</strong>&nbsp;<a href="http://blog.csdn.net/meyoung01/article/details/9325219#" title="view plain" style="background-image: url(http://static.blog.csdn.net/scripts/SyntaxHighlighter/styles/images/default/ico_plain.gif); padding: 1px; display: inline-block; width: 16px; height: 16px; text-indent: -2000px; background-position: 0% 0%; background-repeat: no-repeat no-repeat;">view plain</a><a href="http://blog.csdn.net/meyoung01/article/details/9325219#" title="copy" style="background-image: url(http://static.blog.csdn.net/scripts/SyntaxHighlighter/styles/images/default/ico_copy.gif); padding: 1px; display: inline-block; width: 16px; height: 16px; text-indent: -2000px; background-position: 0% 0%; background-repeat: no-repeat no-repeat;">copy</a><div style="position: absolute; left: 470px; top: 749px; width: 18px; height: 18px; z-index: 99;"></div></div></div><ol start="1"><li style="line-height: 20px;"><span style="color: #993300; font-weight: bold;">&lt;</span><span style="color: #993300; font-weight: bold;">html</span><span style="color: #993300; font-weight: bold;">&gt;</span>&nbsp;&nbsp;</li><li style="line-height: 20px;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #993300; font-weight: bold;">&lt;</span><span style="color: #993300; font-weight: bold;">head</span>&nbsp;<span style="color: #993300; font-weight: bold;">&gt;</span>&nbsp;&nbsp;</li><li style="line-height: 20px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #993300; font-weight: bold;">&lt;</span><span style="color: #993300; font-weight: bold;">title</span><span style="color: #993300; font-weight: bold;">&gt;</span>&nbsp;FrameTest<span style="color: #993300; font-weight: bold;">&lt;/</span><span style="color: #993300; font-weight: bold;">title</span>&nbsp;<span style="color: #993300; font-weight: bold;">&gt;</span>&nbsp;&nbsp;</li><li style="line-height: 20px;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #993300; font-weight: bold;">&lt;/</span><span style="color: #993300; font-weight: bold;">head</span>&nbsp;<span style="color: #993300; font-weight: bold;">&gt;</span>&nbsp;&nbsp;</li><li style="line-height: 20px;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #993300; font-weight: bold;">&lt;</span><span style="color: #993300; font-weight: bold;">body</span>&nbsp;<span style="color: #993300; font-weight: bold;">&gt;</span>&nbsp;&nbsp;</li><li style="line-height: 20px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #993300; font-weight: bold;">&lt;</span><span style="color: #993300; font-weight: bold;">div</span>&nbsp;<span style="color: red;">id</span>&nbsp;=&nbsp;<span style="color: blue;">"id1"</span><span style="color: #993300; font-weight: bold;">&gt;</span>&nbsp;this&nbsp;is&nbsp;a&nbsp;div&nbsp;!<span style="color: #993300; font-weight: bold;">&lt;/</span>&nbsp;<span style="color: #993300; font-weight: bold;">div</span><span style="color: #993300; font-weight: bold;">&gt;</span>&nbsp;&nbsp;</li><li style="line-height: 20px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #993300; font-weight: bold;">&lt;</span><span style="color: #993300; font-weight: bold;">iframe</span>&nbsp;<span style="color: red;">id</span>&nbsp;=&nbsp;<span style="color: blue;">"frame"</span>&nbsp;&nbsp;<span style="color: red;">frameborder</span>=<span style="color: blue;">"0"</span>&nbsp;<span style="color: red;">scrolling</span>=<span style="color: blue;">"no"</span>&nbsp;<span style="color: red;">style</span>=<span style="color: blue;">"left&nbsp;:0;&nbsp;position:absolute;"</span>&nbsp;<span style="color: red;">src</span>&nbsp;=&nbsp;<span style="color: blue;">"iframe.html"</span><span style="color: #993300; font-weight: bold;">&gt;</span><span style="color: #993300; font-weight: bold;">&lt;/</span>&nbsp;<span style="color: #993300; font-weight: bold;">iframe</span><span style="color: #993300; font-weight: bold;">&gt;</span>&nbsp;&nbsp;</li><li style="line-height: 20px;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #993300; font-weight: bold;">&lt;/</span><span style="color: #993300; font-weight: bold;">body</span>&nbsp;<span style="color: #993300; font-weight: bold;">&gt;</span>&nbsp;&nbsp;</li><li style="line-height: 20px;"><span style="color: #993300; font-weight: bold;">&lt;/</span><span style="color: #993300; font-weight: bold;">html</span><span style="color: #993300; font-weight: bold;">&gt;</span><span style="color: #993300; font-weight: bold;">&lt;</span><span style="color: #993300; font-weight: bold;">span</span>&nbsp;<span style="color: red;">style</span>=<span style="color: blue;">"font-family:&nbsp;Tahoma;"</span><span style="color: #993300; font-weight: bold;">&gt;</span>&nbsp;<span style="color: #993300; font-weight: bold;">&lt;/</span><span style="color: #993300; font-weight: bold;">span</span><span style="color: #993300; font-weight: bold;">&gt;</span>&nbsp;&nbsp;</li></ol></div></div><div><div style="font-family: Tahoma; orphans: 2; widows: 2; font-size: 14px;">iframe.html</div><div align="left" style="font-family: Tahoma; orphans: 2; widows: 2; font-size: 14px;"><div bg_html"="" style="width: 936.3368530273438px;"><div><div><strong>[html]</strong>&nbsp;<a href="http://blog.csdn.net/meyoung01/article/details/9325219#" title="view plain" style="background-image: url(http://static.blog.csdn.net/scripts/SyntaxHighlighter/styles/images/default/ico_plain.gif); padding: 1px; display: inline-block; width: 16px; height: 16px; text-indent: -2000px; background-position: 0% 0%; background-repeat: no-repeat no-repeat;">view plain</a><a href="http://blog.csdn.net/meyoung01/article/details/9325219#" title="copy" style="background-image: url(http://static.blog.csdn.net/scripts/SyntaxHighlighter/styles/images/default/ico_copy.gif); padding: 1px; display: inline-block; width: 16px; height: 16px; text-indent: -2000px; background-position: 0% 0%; background-repeat: no-repeat no-repeat;">copy</a><div style="position: absolute; left: 470px; top: 1060px; width: 18px; height: 18px; z-index: 99;"></div></div></div><ol start="1"><li style="line-height: 20px;"><span style="color: #993300; font-weight: bold;">&lt;</span><span style="color: #993300; font-weight: bold;">html</span><span style="color: #993300; font-weight: bold;">&gt;</span>&nbsp;&nbsp;</li><li style="line-height: 20px;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #993300; font-weight: bold;">&lt;</span><span style="color: #993300; font-weight: bold;">head</span>&nbsp;<span style="color: #993300; font-weight: bold;">&gt;</span>&nbsp;&nbsp;</li><li style="line-height: 20px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #993300; font-weight: bold;">&lt;</span><span style="color: #993300; font-weight: bold;">title</span><span style="color: #993300; font-weight: bold;">&gt;</span>&nbsp;this&nbsp;is&nbsp;a&nbsp;frame!<span style="color: #993300; font-weight: bold;">&lt;/</span><span style="color: #993300; font-weight: bold;">title</span>&nbsp;<span style="color: #993300; font-weight: bold;">&gt;</span>&nbsp;&nbsp;</li><li style="line-height: 20px;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #993300; font-weight: bold;">&lt;/</span><span style="color: #993300; font-weight: bold;">head</span>&nbsp;<span style="color: #993300; font-weight: bold;">&gt;</span>&nbsp;&nbsp;</li><li style="line-height: 20px;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #993300; font-weight: bold;">&lt;</span><span style="color: #993300; font-weight: bold;">body</span>&nbsp;<span style="color: #993300; font-weight: bold;">&gt;</span>&nbsp;&nbsp;</li><li style="line-height: 20px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #993300; font-weight: bold;">&lt;</span><span style="color: #993300; font-weight: bold;">div</span>&nbsp;<span style="color: red;">id</span>&nbsp;=&nbsp;<span style="color: blue;">"div1"</span><span style="color: #993300; font-weight: bold;">&gt;</span>&nbsp;this&nbsp;is&nbsp;a&nbsp;div&nbsp;！oo!&nbsp;<span style="color: #993300; font-weight: bold;">&lt;/</span><span style="color: #993300; font-weight: bold;">div</span><span style="color: #993300; font-weight: bold;">&gt;</span>&nbsp;&nbsp;</li><li style="line-height: 20px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #993300; font-weight: bold;">&lt;</span><span style="color: #993300; font-weight: bold;">label</span><span style="color: #993300; font-weight: bold;">&gt;</span>&nbsp;input:<span style="color: #993300; font-weight: bold;">&lt;/</span><span style="color: #993300; font-weight: bold;">label</span>&nbsp;<span style="color: #993300; font-weight: bold;">&gt;</span>&nbsp;&nbsp;</li><li style="line-height: 20px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #993300; font-weight: bold;">&lt;</span><span style="color: #993300; font-weight: bold;">input</span>&nbsp;<span style="color: red;">id</span>&nbsp;=&nbsp;<span style="color: blue;">"input1"</span><span style="color: #993300; font-weight: bold;">&gt;</span><span style="color: #993300; font-weight: bold;">&lt;/</span>&nbsp;<span style="color: #993300; font-weight: bold;">input</span><span style="color: #993300; font-weight: bold;">&gt;</span>&nbsp;&nbsp;</li><li style="line-height: 20px;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #993300; font-weight: bold;">&lt;/</span><span style="color: #993300; font-weight: bold;">body</span>&nbsp;<span style="color: #993300; font-weight: bold;">&gt;</span>&nbsp;&nbsp;</li><li style="line-height: 20px;"><span style="color: #993300; font-weight: bold;">&lt;/</span><span style="color: #993300; font-weight: bold;">html</span><span style="color: #993300; font-weight: bold;">&gt;</span>&nbsp;&nbsp;</li></ol></div><br /></div><div align="left" style="font-family: Tahoma; orphans: 2; widows: 2; font-size: 14px;"><span style="font-family: 'YaHei Consolas Hybrid'; font-size: 12px;"><span style="font-size: 10pt;">2.新建一个Page类，例子类目为P.java，代码如下：</span></span></div><div align="left" style="font-family: Tahoma; orphans: 2; widows: 2; font-size: 14px;"><div align="left"><div bg_java"="" style="width: 936.3368530273438px;"><div><div><strong>[java]</strong>&nbsp;<a href="http://blog.csdn.net/meyoung01/article/details/9325219#" title="view plain" style="background-image: url(http://static.blog.csdn.net/scripts/SyntaxHighlighter/styles/images/default/ico_plain.gif); padding: 1px; display: inline-block; width: 16px; height: 16px; text-indent: -2000px; background-position: 0% 0%; background-repeat: no-repeat no-repeat;">view plain</a><a href="http://blog.csdn.net/meyoung01/article/details/9325219#" title="copy" style="background-image: url(http://static.blog.csdn.net/scripts/SyntaxHighlighter/styles/images/default/ico_copy.gif); padding: 1px; display: inline-block; width: 16px; height: 16px; text-indent: -2000px; background-position: 0% 0%; background-repeat: no-repeat no-repeat;">copy</a><div style="position: absolute; left: 470px; top: 1406px; width: 18px; height: 18px; z-index: 99;"></div></div></div><ol start="1"><li style="line-height: 20px;">import&nbsp;com.holmos.webtest.element.TextField;&nbsp;&nbsp;</li><li style="line-height: 20px;">import&nbsp;com.holmos.webtest.struct.Frame;&nbsp;&nbsp;</li><li style="line-height: 20px;">import&nbsp;com.holmos.webtest.struct.Page;&nbsp;&nbsp;</li><li style="line-height: 20px;">&nbsp;&nbsp;</li><li style="line-height: 20px;">public&nbsp;class&nbsp;P&nbsp;extends&nbsp;Page&nbsp;{&nbsp;&nbsp;</li><li style="line-height: 20px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;P()&nbsp;{&nbsp;&nbsp;</li><li style="line-height: 20px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;super();&nbsp;&nbsp;</li><li style="line-height: 20px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.comment&nbsp;=&nbsp;"iframe页面";&nbsp;&nbsp;</li><li style="line-height: 20px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.init();&nbsp;&nbsp;</li><li style="line-height: 20px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</li><li style="line-height: 20px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;先定位Frame&nbsp;&nbsp;</li><li style="line-height: 20px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;IFrameTest&nbsp;frame&nbsp;=&nbsp;new&nbsp;IFrameTest(&nbsp;"iframe");&nbsp;&nbsp;</li><li style="line-height: 20px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;</li><li style="line-height: 20px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;frame.addIDlocator("frame"&nbsp;);//&nbsp;frame定位用ID定位&nbsp;&nbsp;</li><li style="line-height: 20px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</li><li style="line-height: 20px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;定位Frame里面的元素&nbsp;&nbsp;</li><li style="line-height: 20px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;class&nbsp;IFrameTest&nbsp;extends&nbsp;Frame&nbsp;{&nbsp;&nbsp;</li><li style="line-height: 20px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;IFrameTest(String&nbsp;comment)&nbsp;{&nbsp;&nbsp;</li><li style="line-height: 20px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;super(comment);&nbsp;&nbsp;</li><li style="line-height: 20px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</li><li style="line-height: 20px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;TextField&nbsp;input&nbsp;=&nbsp;new&nbsp;TextField(&nbsp;"输入框"&nbsp;);//&nbsp;定位里面的输入框&nbsp;&nbsp;</li><li style="line-height: 20px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;</li><li style="line-height: 20px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;input.addIDLocator("input1"&nbsp;);&nbsp;&nbsp;</li><li style="line-height: 20px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</li><li style="line-height: 20px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</li><li style="line-height: 20px;">}&nbsp;&nbsp;</li></ol></div><br /></div><div align="left"><span style="font-family: 'YaHei Consolas Hybrid'; font-size: 12px;"><span style="font-size: 10pt;"><br /></span></span></div><div align="left"><span style="font-family: 'YaHei Consolas Hybrid'; font-size: 12px;"><span style="font-size: 10pt;">新建一个Test类，例子类目为P_Test,代码如下：</span></span></div><div align="left"><div align="left"><span style="font-family: 'YaHei Consolas Hybrid'; font-size: 12px;"></span><div bg_java"="" style="width: 936.3368530273438px;"><div><div><strong>[java]</strong>&nbsp;<a href="http://blog.csdn.net/meyoung01/article/details/9325219#" title="view plain" style="background-image: url(http://static.blog.csdn.net/scripts/SyntaxHighlighter/styles/images/default/ico_plain.gif); padding: 1px; display: inline-block; width: 16px; height: 16px; text-indent: -2000px; background-position: 0% 0%; background-repeat: no-repeat no-repeat;">view plain</a><a href="http://blog.csdn.net/meyoung01/article/details/9325219#" title="copy" style="background-image: url(http://static.blog.csdn.net/scripts/SyntaxHighlighter/styles/images/default/ico_copy.gif); padding: 1px; display: inline-block; width: 16px; height: 16px; text-indent: -2000px; background-position: 0% 0%; background-repeat: no-repeat no-repeat;">copy</a><div style="position: absolute; left: 470px; top: 2097px; width: 18px; height: 18px; z-index: 99;"></div></div></div><ol start="1"><li style="line-height: 20px;">import&nbsp;org.junit.Test;&nbsp;&nbsp;</li><li style="line-height: 20px;">&nbsp;&nbsp;</li><li style="line-height: 20px;">import&nbsp;com.holmos.webtest.EngineType;&nbsp;&nbsp;</li><li style="line-height: 20px;">import&nbsp;com.holmos.webtest.utils.HolmosWindow;&nbsp;&nbsp;</li><li style="line-height: 20px;">&nbsp;&nbsp;</li><li style="line-height: 20px;">public&nbsp;class&nbsp;P_Test&nbsp;{&nbsp;&nbsp;</li><li style="line-height: 20px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;P&nbsp;p&nbsp;=&nbsp;new&nbsp;P();&nbsp;&nbsp;</li><li style="line-height: 20px;">&nbsp;&nbsp;</li><li style="line-height: 20px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #646464;">@Test</span>&nbsp;&nbsp;</li><li style="line-height: 20px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;void&nbsp;input()&nbsp;{&nbsp;&nbsp;</li><li style="line-height: 20px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;HolmosWindow.&nbsp;openNewWindow(EngineType.WebDriverChrome,&nbsp;"D:\\main.html"&nbsp;);&nbsp;&nbsp;</li><li style="line-height: 20px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p.frame&nbsp;.select();//&nbsp;选取要操作的frame&nbsp;&nbsp;</li><li style="line-height: 20px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p.frame&nbsp;.input.setText(&nbsp;"试试看！能不能输入"&nbsp;);//&nbsp;操作frame里面的元素&nbsp;&nbsp;</li><li style="line-height: 20px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p.frame&nbsp;.selectTopPage();//&nbsp;控制器交还给最底层页面&nbsp;&nbsp;</li><li style="line-height: 20px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</li><li style="line-height: 20px;">}&nbsp;&nbsp;</li></ol></div><br /></div><div align="left"><span style="font-family: 'YaHei Consolas Hybrid'; font-size: 12px;">执行结果：</span></div><div align="left"><span style="font-family: 'YaHei Consolas Hybrid'; font-size: 12px;"><br /></span></div><div align="left"><span style="font-family: 'YaHei Consolas Hybrid'; font-size: 12px;">控制台输出：</span><img src="file:///C:/Users/HUANGS~1/AppData/Local/Temp/enhtmlclip/Image(2).png" alt="" style="border: none; max-width: 100%;" /></div><div align="left"></div><div align="left"><img src="http://img.blog.csdn.net/20130719143723500?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvaHNqODgwOTIx/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="" style="border: none; max-width: 100%;" /></div><div align="left"></div><div align="left">多层iFrame定位思想是一个样的，一层一层往里边定位。</div></div></div></div></div><div id="bdshare" bds_tools=""  get-codes-bdshare"="" style="z-index: 999999; padding-bottom: 2px; font-size: 12px; float: right; zoom: 1;"><a title="分享到QQ空间" href="http://blog.csdn.net/meyoung01/article/details/9325219#" style="color: #ff9900; text-decoration: none; display: block; font-family: 宋体, Arial; height: 16px; float: left; cursor: pointer; padding-top: 6px; padding-bottom: 3px; padding-left: 22px; background-image: url(http://bdimg.share.baidu.com/static/images/is.png?cdnversion=20131219); background-position: initial initial; background-repeat: no-repeat no-repeat;"></a><a title="分享到新浪微博" href="http://blog.csdn.net/meyoung01/article/details/9325219#" style="color: #ff9900; text-decoration: none; display: block; font-family: 宋体, Arial; height: 16px; float: left; cursor: pointer; padding-top: 6px; padding-bottom: 3px; padding-left: 22px; background-image: url(http://bdimg.share.baidu.com/static/images/is.png?cdnversion=20131219); background-position: initial initial; background-repeat: no-repeat no-repeat;"></a><a title="分享到腾讯微博" href="http://blog.csdn.net/meyoung01/article/details/9325219#" style="color: #ff9900; text-decoration: none; display: block; font-family: 宋体, Arial; height: 16px; float: left; cursor: pointer; padding-top: 6px; padding-bottom: 3px; padding-left: 22px; background-image: url(http://bdimg.share.baidu.com/static/images/is.png?cdnversion=20131219); background-position: initial initial; background-repeat: no-repeat no-repeat;"></a><a title="分享到人人网" href="http://blog.csdn.net/meyoung01/article/details/9325219#" style="color: #ff9900; text-decoration: none; display: block; font-family: 宋体, Arial; height: 16px; float: left; cursor: pointer; padding-top: 6px; padding-bottom: 3px; padding-left: 22px; background-image: url(http://bdimg.share.baidu.com/static/images/is.png?cdnversion=20131219); background-position: initial initial; background-repeat: no-repeat no-repeat;"></a><a title="分享到网易微博" href="http://blog.csdn.net/meyoung01/article/details/9325219#" style="color: #ff9900; text-decoration: none; display: block; font-family: 宋体, Arial; height: 16px; float: left; cursor: pointer; padding-top: 6px; padding-bottom: 3px; padding-left: 22px; background-image: url(http://bdimg.share.baidu.com/static/images/is.png?cdnversion=20131219); background-position: initial initial; background-repeat: no-repeat no-repeat;"></a><span style="background-image: url(http://bdimg.share.baidu.com/static/images/is.png?cdnversion=20131219) !important; display: block; font-family: 宋体, Arial; height: 16px; float: left; cursor: pointer; padding-top: 6px; padding-bottom: 3px; padding-left: 22px; background-position: 0px 5px !important; background-repeat: no-repeat no-repeat !important;">更多</span><a href="http://blog.csdn.net/meyoung01/article/details/9325219#" title="累计分享0次" style="color: #454545; text-decoration: none; display: block; font-family: 宋体 !important; height: 16px; float: left; cursor: pointer; padding: 0px 0px 0px 5px; background-image: url(http://bdimg.share.baidu.com/static/images/sc.png?cdnversion=20120720) !important; margin: 5px 0px 0px; text-align: center; width: 37px; overflow: hidden; font-size: 12px; line-height: 16px; background-position: 0px -30px !important; background-repeat: no-repeat no-repeat !important;">0</a></div><ul style="margin: 0px 0px 5px; color: #666666; font-size: 14px; line-height: 24px; font-family: 'Microsoft YaHei', Arial, Helvetica, sans-serif; clear: both; float: left; padding: 10px 0px 0px;"><li style="list-style-type: none; clear: both; padding: 0px 0px 3px; overflow: hidden;"><span style="display: block; float: left; width: 52px; padding: 0px 0px 0px 27px; height: 26px; background-color: #999999; color: #ffffff; font-size: 14px; margin-right: 7px; background-image: url(http://static.blog.csdn.net/skin/light_blue/images/blog-page-arr.png); background-position: 9px 8px; background-repeat: no-repeat no-repeat;">上一篇</span><a href="http://blog.csdn.net/meyoung01/article/details/9325213" style="color: #333333; text-decoration: none; display: block; float: left; font-size: 14px;">Holmos自动化测试入门学习（三）------处理alert、confirm、prompt对话框</a></li><li style="list-style-type: none; clear: both; padding: 0px 0px 3px; overflow: hidden;"><span style="display: block; float: left; width: 52px; padding: 0px 0px 0px 27px; height: 26px; background-color: #cc0000; color: #ffffff; font-size: 14px; margin-right: 7px; background-image: url(http://static.blog.csdn.net/skin/light_blue/images/blog-page-arr.png); background-position: 9px -22px; background-repeat: no-repeat no-repeat;">下一篇</span><a href="http://blog.csdn.net/meyoung01/article/details/9325261" style="color: #cc0000; text-decoration: none; display: block; float: left; font-size: 14px;">Holmos自动化测试入门学习（五）-----------下拉框选择</a></li></ul></div><dl style="clear: both; overflow: hidden; padding: 25px 20px 10px; margin: 10px 0px 0px; background-color: #f5f5f5; font-family: Arial, Console, Verdana, 'Courier New'; font-size: 13.333333969116211px; line-height: normal;"></dl><img src ="http://www.blogjava.net/qileilove/aggbug/413563.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/qileilove/" target="_blank">顺其自然EVO</a> 2014-05-12 16:09 <a href="http://www.blogjava.net/qileilove/articles/413563.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>