Implementing the ITCL (or IBM) Framework using Rational Functional Tester
来源:互联网 发布:超星阅读器windows版 编辑:程序博客网 时间:2024/05/21 00:19
Introduction
There are many forums and communities that define the IBM framework (or ITCL framework): what it is, how it works, and its underlying advantages. The objective of this article is to focus on the implementation of the IBM framework. It will define how the IBM framework can be implemented while using IBM® Rational ®Functional Tester for automating the functional tests of an application.
The framework
The IBM framework, formerly known as the ITCL framework, was developed by the Quality Software Engineering team in collaboration with experienced automation teams throughout IBM. The framework consists of a three-tiered architecture implemented through the appobjects, tasks, and test cases packages (the IBM package).
The principles underlying the appobjects, tasks, and test cases packages are:
- Layered architecture
- Separation of the "what" from the "how"
- Code reuse
- Consistent and clear organization
- Ability to ramp up quickly
- Quick debugging
- Organize files effectively
- Enabling collaboration
- Learning from others
Here's an explanation of appobjects, tasks, and test cases:
- AppObjects: where you will store information about your application’s GUI elements. It is also where you will write your Getter Methods, which return objects enabling the Caller to query and manipulate these GUI elements. Typically, these methods are called within the Task layer.
- Tasks: where you will write reusable methods that exercise common functions in your application. It is also where you will write methods to manipulate and query complex, application-specific controls. Methods in the Task are called by Test Cases.
- Test Cases: methods that navigate through an application, verify its state, and log results.
Implementation methodology
The methodology outlined in this section defines a 5-step procedure to implement the IBM framework.
STEP 1. First, create a new project on your local drive. The project will have a repository in which you can store, maintain, compile, and run your automation code. In Functional Tester, select File > New > Functional Test Project. Name your project and click Finish.
STEP 2. Import the IBM package -- which contains utility classes that will be used extensively in the automation scripts -- into your project. Although it is possible to simply relate the path to the ibm.jar file, importing the IBM package into your project will make it easier for you to examine the package’s contents, and step into the package later when debugging. The IBM package can be downloaded from the download table at the bottom of this article.
Importing the ibm.jar package
- In IBM Rational Functional Tester, go to the Projects view on the left side of your screen and click on the project created in STEP 1.
- Select File > Import. Select Zip file and click Next. Use the Browse button to find the ibm.jar or ibm.zip file in the location you chose to store the file.
- Leave all settings at their default and click Finish.
- You should now be able to expand the name of your project in the Functional Test Projects view. You should see a folder underneath it called ibm.
STEP 3. Create a package called AppObject.
- In Rational Functional Tester, go to the Projects view on the left side of your screen and click on the project created in STEP 1.
- Pick File > New > New Test Folder.
- Name the folder AppObject.
- Click Finish.
- Repeat Steps 1-4 to create Tasks and TestCase folders too.
What is an AppObject Package?
In this package you have to map all the objects of the application under test. A general recommendation is to prepare separate scripts for each screen to ensure better re-use and organization of the objects and classification. For example, create a script called login that will keep all objects related to the login screen. You can also create others related to sent, inbox screens, and so on.
Working with the AppObject folder
- Create an empty script in the AppObject Package.
- Select the AppObject package, Right-click and select Add Empty Script, as shown in Figure 1.
Figure 1. Adding an empty script
- Specify the name as Login and click Finish
- From the script explorer double-click Private Object Map.
- Make sure that the mail.yahoo.com site (or the application under test) is open.
- From the Private Object map, click on Test Object > Insert Object(s), as shown in Figure 2.
Figure 2. Inserting a test object
- Drag the hand icon tool from the below dialog to the object that you want to map, as shown in Figures 3 and 4.
Figure 3. Selecting an object by dragging it
Figure 4. Object selected
- Click Finish.
- Your Private Object Map screen should look like that shown in Figure 5.
Figure 5. Completed Private Object Map
- Select the object you recently added, right-click it, and select Add to Script AppObject.Login.
- Repeat steps 6-10 for all objects you want to add into this script.
- Click File > Save from the Private Test Object and close this. Your script explorer should look like that in Figure 6.
Figure 6. Script Explorer for Login
- Similarly, you can create as many scripts as you want to add into the project, and add the related objects as well.
Generating AppObjects code automatically
Once you have added your objects to your object maps, you can generate your getters automatically by writing a few lines of code. These getters help you to access the objects across/with in project added in the script. You will create an empty script within the AppObject folder, and write the code shown in Listing 1 to generate the getter automatically.
- Create an Empty Script called getter within the AppObject folder.
- Create the code in Listing 1.
Listing 1. Code to generate getters automatically
3.Your Getter script contents should look like that shown in Figure 7.
Figure 7. The Getter script
- Run the script by selecting Script > Run.
- After running once, when you click your Login script it will ask you if you want to load the changes.
- Click Yes and you should see that your Login script has the Getter function, as shown in Figure 8.
Figure 8. Login function with the Getter script
STEP 4. Creating tasks
A task is the place where you will write the most reusable complex code.
- First Create a Script within the Tasks folder (as you did previously in the AppObject Folder).
- Select the Tasks folder. Right-click it and select Add Empty Script.
- Specify the name(LoginTask) and click Finish.
- Insert the code in Listing 2 into the script.
Listing 2. Login task
- Your script contents should look like that shown in Figure 9.
Figure 9. Amended script contents
- You can add as many functions as required in the same script, or in new script(s) as per the application requirements.
Next, you are going to automate these functions.
STEP 5. Creating Test Cases
In Test Cases, you write the actual steps to perform the action. This will inherit the properties from the Tasks and the Appobject.
- First create a script within the Test Case folder (as you did previously in the AppObject folder).
- Select the Test Case folder. Right-click it and select Add Empty Script.
- Specify the name(YahooLogin) and click Finish.
- Insert the code shown in Listing 3 into the script.
Listing 3. Test case
- Your script contents should now look like those shown in Figure 10.
Figure 10. Final script
6.Now run the script. it should open the browser, enter the user name and password, and then login into the Yahoo account.
Summary
The IBM framework can be implemented by following the five steps outlined in this article. The examples and code snippets herein are relevant to Rational Functional Tester. These may vary depending on whether other implementations of the IBM framework are using another tool.
Reproduced link:
http://www.ibm.com/developerworks/rational/library/06/0822_goel/
- Implementing the ITCL (or IBM) Framework using Rational Functional Tester
- IBM Rational Functional Tester 软件
- IBM Rational Functional Tester用户手册(一)
- 使用 IBM Rational Functional Tester 7.0.1 测试 Flex 应用程序
- IBM Rational Functional Tester V8.1新增功能简介
- 使用 IBM Rational Functional Tester: 了解和使用 TestObject.find 方法
- 使用 IBM Rational Functional Tester测试 Windows 应用程序: 如何构建结构良好的测试框架
- 脚本执行期间在 IBM Rational Functional Tester 中获取并筛选日志
- 使用 IBM Rational Functional Tester 8.2.1 自动化 Flex Spark 测试
- 通过命令行启动RFT(Rational Functional Tester)
- Rational Functional Tester 对象关系图
- 通过命令行启动RFT(Rational Functional Tester)
- Robot到Rational Functional Tester和Performance Tester
- Robot到Rational Functional Tester和Performance Tester
- 介绍 IBM Rational Manual Tester V7.0
- IBM Rational Performance Tester V7.0 介绍
- 使用Rational Functional Tester实现动态的校验点测试
- 使用 Rational Functional Tester V7.0 测试 Mozilla Firefox 应用程序
- TNS:监听程序无法启动专用服务器进程,
- 自己封装实现的仿GridView的列表控件
- spring.net与MyBatis.NET的整合
- [sql server] 问题总结12---合并列值
- web.xml解读
- Implementing the ITCL (or IBM) Framework using Rational Functional Tester
- linux shell脚本_文件的批量删除_2.0
- 列出比较容易忘记的 C++(C)语言语法及标准库
- rapi.dll 简介
- java替换文章内容中的热链
- ECSHOP文件结构
- SQL语句复制表
- ecshop 框架 简单分析
- The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.