Before this July and next self-dealing system, i 'd like to learn anything of RFT......

翻译:Using Rational Functional Tester V7.0 to test Mozilla Firefox applications

上一篇 / 下一篇  2007-06-08 20:58:49 / 个人分类:混沌初期

                 The Preface of My Diary

Except for my formal-work , the study-task i should finish today is to translate this article which is fromhttp://www.ibm.com/developerworks/rational/library/06/1219_kelly/index.html#author 

into Chinese

the reason why i'd like to spend my time doing this is not only for its careful descrīption , but also an indelible impression would be made on me when writting words by words ....

people who is interested in it could check the original text by the link above.i'd like to share all of the things i know to you ,although there is not much.

then , the words below is what i have done today.......

 

 

文章题目:

使用 ibm RFT 测试基于mozilla firefox 浏览器的应用

(using ibm rational functional tester to test mozilla firefox application)

级别:入门

IBM RFT支持基于mozilla firefox浏览器HTML应用,本文就这一功能如何应用到自动化测试进行探讨。

FRT 提供了一种自由的选择,java脚本和开发环境或者是visual basic.net脚本和开发环境,都可行。这意味着在开发自动化测试过程中,你可以像杠杆一样充分整合不同的开发者、开发语言、平台。

我们将使用RFT7.0,在Mozilla firefox 2.0浏览器上,测试一个HTML应用。选择java环境。不过,别担心,如果你使用的是.net,操作过程基本上是一致的。

note:测试中的作者使用的是RFT7.0,Microsoft® Windows® XP Professional operating system (SP2),Mozilla Firefox V2.0 。对于其它的操作系统和浏览器,RFT也是一样的原理。

标题一、测试运行在Mozilla Firefox version 2.0上的HTML应用

本文通过例子来道方法,可以一箭双雕,既可以告诉大家测试的方法,也可以展示RFT最基本的特点。

例子:假设你要在www.bookpool.com上定购一本关于java的书。

1.启动RFT, 打开一个已有的工程;

2.点击click a functional test scrīpt, 输入一个名字来命名这个脚本;

Figure 1. Record a Functional Test scrīpt screen display

 

 

3.点击finish ,开始录制。录制的界面,见图二,将打开;.
Figure 2. Recording window

4.点击start application ,以打开启动应用的界面,见下图三
Figure 3. Start Application window

5.为了将book.com url 添加到应用列表中,点击edit application list;

6.在application configuration tool界面中,见下图4,点击edit add;
Figure 4. Application Configuration Tool window

7.在add application 界面中,选择所测试的应用的类型,在本例中我们选择HTML application,然后点击next
Figure 5. Add Application window

8.在add application 的select html application 界面中,url栏中输入www.bookpool.com,然后点击finish
Figure 6. Add the URL in the Select HTML application view

9.在application configuration tool的edit application information 界面中,你可以看到bookpool 的url已经存在于application的列表中;

10.务必要在brower 栏目中选择mozilla firefox;
Figure 7. Edit Application Information window

  1. 点击finish;

 12.界面自动返回到start application 界面,在application name 中选择url,然后点击ok,网页bookpool.com将会自动在浏览器中打开;

13.在网站的搜索栏中输入java,以搜索出一本关于java 的书,见下图8;
Figure 8. Search the Web site for a book about Java
Figure 8. Search the Web site for a book about Java

14.在显示出搜索结果的页面,我们希望将列表中的第一本书添加到购物车中,于是点击add to basket,见图9;
Figure 9. Add the first book from the search results to your shopping basket
Figure 9. Add the first book from the search results to your shopping basket

15.你应该可以看到书已经放到了购物车中,但是为了确保它确实在购物车中了,我们需要输入一个检查点(a verification poin)。首先,点击insert verification point or the action command。你将会看到verification point and action wizard界面打开,见图10;

Figure 10. Verification Point and Action Wizard screen
Figure 10. Verification Point and Action Wizard screen

16.使用object finder来选择列表中,关于那本书的相关数据。你将会看到一圈红色的边边围在外圈。见图11
Figure 11. Use the Object Finder to select the book that you want to order
Figure 11. Use the Object Finder to select the book that you want to order
17.在verification point and action wizaird界面中,选择perform propertiese verification poin,见图12,然后点击next;(插一句:faint,还不知道为什么要选择这个,而不是其它........!)
Figure 12. Verification Point and Action Wizard
Figure 12. Verification Point and Action Wizard

18.在insert properties verification point command 界面中,见图13,确定include children栏目中选择的是all,然后点击next;(再插一句:faint ,还不清楚include childern是什么意思?........
Figure 13. Insert Properties Verification Point Command window
Figure 13. Insert Properties Verification Point Command window

19.在接下来的界面中,见图14,你将需要选择一些性质,以把验证点包含进去。(原话:The next screen prompts you to select the properties to include in the verification point. )你可以通过操纵test object 树,到其旁边包含有所选择书的html的表格,来检查。(Navigate through theTest Objectstree to the table that contains the HTML for the book that you selected, andcheckthat box. );(i am sorry,自己没搞懂)

20.然后检查property 列表中的内容;(Then check the box in thePropertylist. )(sorry!)

Figure 14. Verification Point Data window
Figure 14. Verification Point Data window 

  1. 点击finish,关掉浏览器,停止录制;

RFT 现在应当生成了一个脚本,它看起来应该很像下面的这一个listing1;

Listing 1. scrīpt generated by Rational Functional Tester

import resources.AddToCartHelper;

import com.rational.test.ft.*;
import com.rational.test.ft.object.interfaces.*;
import com.rational.test.ft.object.interfaces.SAP.*;
import com.rational.test.ft.object.interfaces.siebel.*;
import com.rational.test.ft.scrīpt.*;
import com.rational.test.ft.value.*;
import com.rational.test.ft.vp.*;

/**
 * Descrīption   : Functional Test scrīpt
 * @author Michael
 */
public class AddToCart extends AddToCartHelper
{
	/**
	 * scrīpt Name   :AddToCart* Generated     :Nov 5, 2006 2:53:22 PM* Descrīption   : Functional Test scrīpt
	 * Original Host : WinNT Version 5.1  Build 2600 (S)
	 * 
	 * @since  2006/11/05
	 * @author Michael
	 */
	public void testMain(Object[] args) 
	{
		startApp("www.BookPool.com");
		
		// Window: firefox.exe: Bookpool Discount Computer Books. Welcome!
		texttext().click(atPoint(78,10));
		bookpoolDiscountComputerBooksW().inputChars("Java");
		httpGBookpoolComHpSearch_btnGi().click(atPoint(24,11));
		
		// Window: firefox.exe: Bookpool: Books Found - Mozilla Firefox
		cellwin().click(atPoint(0,0));
		
		// Window: firefox.exe: Bookpool: Shopping Basket - Mozilla Firefox
		cellwin2().performTest(Cell_standardVP());
		bookpoolShoppingBasketMozillaF(ANY,MAY_EXIT).click(CLOSE_BUTTON);
	}
}

接下来,运行这个刚刚录制好的脚本。

1.就在仍然打开着的脚本界面中,点击工具条中的run functional test scrīpt,会打开一个select log

界面,如下图15;
Figure 15. Select Log window
Figure 15. Select Log window

  1. 2.点击finish 来开始运行。当脚本在运行的过程中,你会看到playback界面,这个界面能让你

对当脚本由于某些原因停顿时会发生什么,有个概念;(号绕口,sorry,原文:

This window can give you an idea of

what's happening if the scrīpt appears to be stalled for some reason.

Figure 16. Playback window
Figure 16. Playback window

 

 

 

 

 

当脚本执行完毕后,你的桌面上会打开一个浏览器,来显示测试运行的结果,见图17;
Figure 17. Results of the test run
Figure 17. New browser window that displays the results of the test run

(接下来一段就不罗嗦了......真不是想偷懒)

 

 

For more information or help

If you want a more detailed walkthrough of recording and playing back a scrīpt, read theGetting Started with Functional Tester Cheat SheetunderHelp > Cheat Sheets. And don’t forget: You can always get help in theFunctional and GUI Testing forumon developerWorks (also listed inResources).



 

Resources

Learn


Get products and technologies


Discuss



 

About the author

Michael Kelly is currently an independent consultant and provides custom training in the IBM Rational testing tools. He consults, writes, and speaks on topics in software testing. He is currently serving as the Program Director for the Indianapolis Quality Assurance Association and is a Director at Large for the Association for Software Testing. He can be reached by email at Mike@MichaelDKelly.com.






TAG: 混沌初期

 

评分:0

我来说两句

日历

« 2024-05-03  
   1234
567891011
12131415161718
19202122232425
262728293031 

数据统计

  • 访问量: 11288
  • 日志数: 19
  • 书签数: 1
  • 建立时间: 2007-04-09
  • 更新时间: 2007-06-23

RSS订阅

Open Toolbar