87
<Title of the Presentation> TRAINING December 16, 2006 IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved 1 Automation Testing & IBM - Automation Testing & IBM - RFT RFT Vijay Chowthri N Vijay Chowthri N [email protected] [email protected] [email protected] [email protected] icargo – Automation Testing Team icargo – Automation Testing Team

Rational Functional Tester - upload

Embed Size (px)

Citation preview

Page 1: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

1

Automation Testing & IBM - Automation Testing & IBM - RFTRFT

Vijay Chowthri NVijay Chowthri N

[email protected]@[email protected]@gmail.com

icargo – Automation Testing Teamicargo – Automation Testing Team

Page 2: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

Copyright © IBS Software Services. All Rights Reserved

Understanding Automation Testing

Web Automation

Road map to Success

RFT – Training (Session 1 to 4)

AgendaAgenda

Page 3: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

Copyright © IBS Software Services. All Rights Reserved

Automation Automation TestingTesting

Why ?

What's Automation Testing ?

-> Frequency Of regression testing on demand.

-> Frequency of build

-> Mission critical business

-> To avoid Human errors

-> To check Load Capacity of the application.

-> GUI Frozen

When ?

Test automation is the use of software to control the execution of tests (Test Test automation is the use of software to control the execution of tests (Test Case).Case).

Commonly, test automation involves automating a manual process already in Commonly, test automation involves automating a manual process already in place that uses a formalized testing process.place that uses a formalized testing process.

-> Reduce the impact on the bottom line (Regression Testing)-> Increase the flexibility of time and resource , to avoid redundancy on execution.

-> Accuracy & Fast

Page 4: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

Copyright © IBS Software Services. All Rights Reserved

Automation Testing - Capabilities and Areas

Is it Expensive ?

1) Functionality testing

2) Regression Testing

3) Performance Testing

3.a) Stress Test

3.b) Load Test

3.c) Volume Test

Yes of course ! Its expensive and time consuming effort at initial stage.

Page 5: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

Copyright © IBS Software Services. All Rights Reserved

Are you thinking of 100% Automation ?

-> Impossible ..Stop Dreaming…….

-> Certainly you have areas like performance testing, regression testing, load/stress testing where you can have chance of reaching near to 100% automation.

-> Areas like User interface, documentation, installation, compatibility and recovery where testing must be done manually.

Will your automation suite be having long lifetime?

-> Every automation script suite should have enough life time that its building cost should be definitely less than that of manual execution cost.

-> Approximately your automation suite should be used or run at least 20 to 30 times for separate builds (General assumption. depends on specific application complexity) to have good ROI.

Is Tool Selection more Important ?

-> Be sure to have skilled staff before deciding to automate your testing work.

-> Make sure that tool is a best fit to your requirements

-> Find out the limitations of the tool that is best match with your requirements

Page 6: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

Copyright © IBS Software Services. All Rights Reserved

Web AutomationWeb Automation

Why web app is different ? (web based commercial system B-C, B-B & C-C)

-> Catering to large number of end user

-> People with varying background & technical skills may use the application.

-> Network thread (Security , Connection speed (Broad band , dial-up etc.. ))

-> Numerous application usage

-> Browser issue (IE ,Mozilla fire-fox etc.., )

-> ADA (American with disability act) (The Application may need to be tested for compliance and usability)

-> Money & Time Zone Factor (Standards)

Hence a lot of effort needs to put in for Test Planning and Test Design

Page 7: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

Copyright © IBS Software Services. All Rights Reserved

Road Map to Road Map to success – The success – The Eight Rule’sEight Rule’s

Rule 1: Get familiar with Business

Rule 2: Get familiar with Tool

Rule 3: Have at least one real programmer in your team

Rule 4: Set some standards

* Naming standards* Coding standards* Environment standards* Procedure for error and defect tracking system* Documentation

Rule 5: Figure out what you are testing and keep simple

Page 8: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

Copyright © IBS Software Services. All Rights Reserved

Rule 6: Start with small mile stone

Rule 7: Modularize and build reusability into your scripts

Rule 8: Document Everything

Page 9: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

Copyright © IBS Software Services. All Rights Reserved

Automation PlanAutomation Plan

Manual testing

Patch -1 Patch -2 Int.Build

Start Automation Scripting

Hot Fix Hot Fix Hot Fix

Main Release

Repeatable Scenario

New customization scenario

Auto . Pack

Page 10: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

Copyright © IBS Software Services. All Rights Reserved

Automation Frame Automation Frame Work iCargoWork iCargo

Application

Automation Tool

Script (n)

Action

Data Set

Object Repository

Log

Re-Usable Action and

Functions

Error handling

Checks / Verification

Data Handling function

Report function

Page 11: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

Copyright © IBS Software Services. All Rights Reserved

Rational Functional TesterRational Functional Tester

Session – 1 (beginner)Session – 1 (beginner)

Vijay Chowthri NVijay Chowthri Nicargo – Automation Testing icargo – Automation Testing

TeamTeam

TrainingTraining

Page 12: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

12

Introduction to Rational functional Tester

Features

Risks and Best Practices

Create Rational Test Project

Advantages

Configure Test Application

Start Script Recording

Capture Data Pool Fields

Capture Verification Points

Playback Test Script and View Log

Agenda ( Session – 1 )Agenda ( Session – 1 )

Page 13: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

Copyright © IBS Software Services. All Rights Reserved

System Requirements

Processor : Pentium- 4 , 1.4 + GHz

RAM : Min 500 MB Recommended 1GB

OS : Win 2x, XP.

Hard Disk Space : 500MB

Page 14: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

14

Object-oriented automated testing tool that tests Java, HTML, VB.NET, and Windows applications.

Create and edit simple and easy-to-read, object-oriented test scripts.

Available in two integrated development environments and two scripting languages Java and VB.NET

Perform full functional testing. Record and play back scripts that navigate through the application and test the state of objects through verification points.

IntroductionIntroduction

Page 15: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

15

In addition to automatically recording test scripts, Functional Test contains wizards for generating code, for example, for automatically creating a verification point.

The object-oriented recording technology in Functional Tester lets you generate scripts quickly by recording applications against the application-under-test. Functional Tester uses object-oriented technology to identify objects by their internal object properties, not by screen coordinates. If the location or text of an object changes, Functional Tester can still find it on playback.

Back

IntroductionIntroduction

Page 16: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

16

FeaturesFeatures

Functional Object Map:

Since the test object map contains recognition properties for each object, we can easily update the recognition information in one central location. Any scripts that use this test object map also share the updated information.

Verification points:The verification point captures object information

(based on the type of verification point) and stores it in a baseline data file. The information will be the baseline of the expected state of the object during subsequent builds.Platform Independence: Functional Test features platform-independent and browser-independent test playback.

Page 17: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

17

FeaturesFeatures

Data-Driven Tests:Data-driven testing uses data from an external file,a

data pool, as input to a test. A data pool is a collection of related data records that supplies data values to the variables in a test script during test script playback.

Call Script:While recording or editing a Functional Test script,

we can insert a call to a previously recorded script. This lets us to avoid repeatedly recording similar actions on the application-under-test by taking advantage of scripts that already exist.Wait For Existence:

Use to set a wait state for an object during playback to check for its existence.

Page 18: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

18

FeaturesFeatures

Break Point:A breakpoint causes the execution of a program

thread to suspend at the location where the breakpoint is set. When a breakpoint is enabled, it will cause a thread to suspend whenever the breakpoint is reached

Integration with Test Manager:Functional Test is integrated with Rational Test

Manager, which enables us to record and play back a Functional Test script from Test Manager.

Back

Script Assure Technology:Frequently changes applications UI can break tests,

Which embody assumptions about how to identify the interface objects during playback Avoid increases in maintenance overhead.

Page 19: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

19

AdvantagesAdvantages

Reduction of time – Data correlation

Reduction of Human Involvement / Errors

Less Maintenance

More Reliable

More Accurate

ReusableBack

Page 20: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

20

RisksRisks

Re-work on the recorded script happens if the application under test is not stable.

The Testers must be well trained on the tool, Business Knowledge to ensure effective Scripting and testing.

RFT will take huge amount of system memory when play back the scripts.

LOV selection is more complicate one.

Some basic script and OOPS knowledge needed to ensure effective and optimised Scripting. (at least one developer support Required)

Page 21: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

21

Best Practices For Basic ScriptingBest Practices For Basic Scripting

While recording avoid TAB positions, instead click on the specific object, AVOID KEY BOARD.

Even though there is a default curser position, click on the object explicitly

Avoid Clicking on the Calendar components, instead type the values manually

Before Starting recording, Click on the initial window from where the recoding needs to be started

Page 22: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

22

Best Practices For Basic ScriptingBest Practices For Basic Scripting

Maintain the dedicated Application Server and DB.

If possible, communicate with developers for component changes that had happened in the new release so that it would be easier to trace those position in the recorded scripts

Back

Test Design, common objects map, common data pool and component based scripting improve the script quality.Record the mandatory Fields only.

Page 23: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

23

Create Rational Test ProjectCreate Rational Test Project

Select FILE-> NEW -> Rational Test Project from Main Menu.

Enter the Project name and Select the Project Location.

Click on the Finish button

Back

Page 24: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

24

Configure Test ApplicationConfigure Test Application

Select Configure -> Configure Application for Testing

Click on the “Add” button to configure another Application

Page 25: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

25

Configure Test ApplicationConfigure Test Application

Select Kind of Application as HTML then “Next” button

Enter the URL of the Application http://n7043:7043/icargo

Page 26: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

26

Configure Test ApplicationConfigure Test Application

Click on the “Finish” Button

Back

Page 27: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

27

Start Script RecordingStart Script Recording

Select File -> New -> Functional Test Script Using Recorder

Page 28: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

28

Start Script RecordingStart Script Recording

Select the Project in which the Script to be recordedSpecify the Script name and Click on the “Next” button

Page 29: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

29

Start Script RecordingStart Script Recording

Specify the Test Object Map, Helper Super Class and Test Data pool

Specify the Data pool record selection order then click on the “Finish” button

System will display a recording window

Page 30: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

30

Start Script RecordingStart Script Recording

Start application by clicking on the Button indicated in the window displayed

Select the Application which has to be recorded

Page 31: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

31

Start Script RecordingStart Script Recording

Record the Application Functionalities as required

Click on the Stop button once recording has been completed

Page 32: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

32

Back

Page 33: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

33

Capture Data Driven CommandsCapture Data Driven Commands

Select the script in which the Data Driven commands to be inserted

Select Script-> Insert Data Driven Commands

Make sure the Application should be running for capturing Data driven commands

Press and Drag the Hand icon to select the Test objects from the “Insert Data Driven Actions” pop up displayed

Page 34: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

34

Capture Data Driven CommandsCapture Data Driven Commands

Page 35: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

35

Capture Data Driven CommandsCapture Data Driven Commands

Select the objects from Application for which Data Driven commands required

Captured details of the selected objects will be displayed in the “Insert Data Driven Actions” pop up screen

Page 36: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

36

Capture Data Driven CommandsCapture Data Driven Commands

Page 37: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

37

Capture Data Driven CommandsCapture Data Driven CommandsClick on the “Ok” button if the Data capture Completed

Back

Page 38: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

38

Capture Verification PointsCapture Verification Points

Select the script in which the Verification Points to be inserted

Select Script-> Insert Verification points

Make sure the Application should be running for capturing Verification Points

Press and Drag the Hand icon to select the Test objects from the “Verification Point and Action Wizard” pop up displayed

Page 39: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

39

Capture Verification PointsCapture Verification Points

Page 40: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

40

Capture Verification PointsCapture Verification Points

Select the objects from Application on which Verification Point required

Select the action to perform against the selected object, then click “Next” button

Page 41: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

41

Capture Verification PointsCapture Verification Points

Page 42: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

42

Capture Verification PointsCapture Verification Points

Enter the Data Value, Verification Point Name, Max Retry Time and Retry interval, then click on the “Next” button.

Check for the properties of the object to include in the verification point, then click on the “Finish” button.

Next

Page 43: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

43

Capture Verification PointsCapture Verification Points

Back

Page 44: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

44

Playback Test script and View LogPlayback Test script and View Log

Select the Script which has to be played.

Select Script-> Run from the main menu.

Specify the Log name , then Click on the “Next” button

Page 45: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

45

Playback Test script and View LogPlayback Test script and View Log

Specify the Run Arguments and Data pool Iteration Count.Click on the “Finish” button.

Play Back status pop up screen will be displayed. This screen will be closed automatically after completing all the actions specified in the Script currently playing

Page 46: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

46

Playback Test script and View LogPlayback Test script and View Log

Rational Functional Tester will display the Log file automatically once after completion of the script running,if defaulted in the settings.

Script passed or failed information will be available in the Log file.

Verification point Result can be verified from the Log displayed

Page 47: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

47

Playback Test script and View LogPlayback Test script and View Log

Page 48: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

48

&Q U E S T I O N SQ U E S T I O N SA N S W E R SA N S W E R S

Page 49: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

49

Rational Functional Rational Functional TesterTester

Session - 2Session - 2

Page 50: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

50

Agenda ( Session -Agenda ( Session -2)2)

Understanding Test Objects

Understanding Test Datapool

Test Objects Capture

Page 51: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

51

Understanding Test Objects Understanding Test Objects

A Test Object in represents a connection point between the script that is playing back and the Software Under Test (SUT). There is a corresponding object that exists in the SUT for the Test Object that exists in the RFT script.

In the normal course of action statements are recorded and objects are added to the Object Map.

The Object Map contains information that the script can then use to construct and find a Test Object When something like Button().click() is recorded the Button() method finds an object based on mapped properties and then “binds” the Test Object to an object in the SUT.

Page 52: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

52

Understanding Test Objects Understanding Test Objects

Page 53: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

53

Test Test Objects Objects

Private Test Private Test Objects Objects

Common / Common / Shared Test Shared Test

Objects Objects

Private Test object Associate with single scripts.

Shared single object map associated with multiple Scripts, ( advisable implementation)

Page 54: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

54

Create Common Test Objects Create Common Test Objects

Add New Test object map, by using left click of mouse, (or) Select From Menu File >> New >> Test Object Map

Page 55: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

55

Sharing The Test Objects with Scripts Sharing The Test Objects with Scripts

Add New Script, by using left click of mouse, (or) Select From Menu File >> New >> Empty Functional Test Script>>>Click Next

Page 56: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

56

Sharing The Test Objects with Sharing The Test Objects with Scripts Scripts

>> Browse the test object map and assign the Shared Test Object with this script.

Page 57: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

57

>> Create new script (Script2) share the Test object Map

>> Extend the Script1 class in Script2 & start use the Script1 object / Scripts

public class Script2 extends Script1{

/** * Script Name : <b>Script2</b> * Generated : <b>Sep 24, 2008 2:27:11 PM</b> * Description : Functional Test Script * Original Host : WinNT Version 5.1 Build 2600 (S) * * @since 2008/09/24 * @author a-2778 */public void testMain(Object[] args) {

text_username().click();

}}

Example ::

Page 58: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

58

Understanding Test Datapool Understanding Test Datapool

A datapool is a test dataset, a collection of related data records which supplies data values to the variables in a test script during test script playback.

Datapools use to supply realist data and to stress an application with a realistic amount of data.

Datapool Feature

To add realistic data to a test script

To import / Export data from a Functional Tester datapool, an IBM® Rational® Test Manager datapool, or a .csv file created using a spreadsheet application.

To create a datapool manually and add data to a datapool

To edit datapool values or change data types

To change the datapool record selection order to determine how the test script accesses an associated datapool during playback.

Page 59: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

59

Page 60: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

60

Test DatapoolTest Datapool

Common / Shared Common / Shared Test DatapoolTest Datapool

Private Test Private Test DatapoolDatapool

Private Test Datapool data's usable with in the single scripts.

Shared Test Datapool data's can be shared with multiple Scripts.

Page 61: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

61

Create Common Test Datapool Create Common Test Datapool

Add New Test Datapool, by using left click of mouse, (or) Select From Menu File >> New >> Test Test Datapoolwe can create Table Name (variable name) and add multiple Record. (Left click on the Datapool to access this option)

Page 62: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

62

Access Shared Datapool in the Access Shared Datapool in the ScriptScript

Associate Scripts with data pool

Page 63: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

63

Insert New Object (Another Insert New Object (Another Method)Method)

Create a new Script

Double Click on the Private / Shared Test Object in the Script Explorer

Click the Test Object Button

Page 64: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

64

>> Drag the hand button and select the object and click Finish Button.

Page 65: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

65

>> Click Save

>> Click Add to Script button ( to add the object in to scripts )

>> Close the Window

Page 66: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

66

Session – 3 Session – 3 (Moderate)(Moderate)

Rational Functional Rational Functional TesterTester

Page 67: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

67

Agenda (Session - Agenda (Session - 3)3)

Data base Connectivity (Oracle)

Page 68: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

68

Effective database testing with IBM Rational Effective database testing with IBM Rational Functional Tester Functional Tester

Automated database testing is faster and more reliable the traditional GUI-based test automation.

Resource Competence

Familiar with the basic SQL commandsHands of experience / Exposure in Manual DB TestingHave an interest in automating some of that testing

Page 69: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

69

What Can be Test ?What Can be Test ?

The types of database activity (insert, delete, update) that will be invoked

When these transactions will occur within the application-under-test

The calculations or processing rules used by the application Any time-critical transactions, functions, conditions, and possible causes of poor performance

Data fields to ensure proper data types For proper spacing and length Data formats that may not be enforced by a data type For duplicate data Reference data to ensure that the data you are expecting is there Data migration Test Phase

Page 70: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

70

DB Configuration in DB Configuration in RFTRFT

>> Select “Properties” in the RFT Main Menu

Page 71: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

71

>> In the Properties pop-up window select “Java Build path”

>> Select “Libraries” Tab

>> Click “Add External Jar” Button

>> Select the Oracle client / server JDBC connectivity Jar file <oracle9204 \\ jdbc \\ lib>

>> Click “OK” Button

Page 72: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

72

Driver Connectivity ClassDriver Connectivity Class Once the Driver Configuration Over , Create connectivity Class.

public class oraconnection {

public static Object connection;

public Connection connect() throws SQLException

{

Connection connection;

Driver driver = new oracle.jdbc.OracleDriver();

DriverManager.registerDriver(driver);

connection = DriverManager.getConnection("jdbc:oracle:thin:@(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = n7355.IBSPLC.COM)(PORT = 1521)))(CONNECT_DATA = (SERVER = DEDICATED)(SERVICE_NAME = ICTST)))", "USERNAME", "PASSWORD");

connection.setAutoCommit(true);

return connection;

}

public ResultSet query(String string) {

return null;

}

}

Page 73: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

73

ExampleExampleThe sample script explains insert new user Details in the DB , By using the connection class.

public void testMain(Object[] args)

{

oraconnection connection = null;

ResultSet results;

try

{

connection = new oraconnection();

logInfo("Connected");

results = connection.query("Select * from SHRAGTMST where AGTCOD LIKE 'A1001'");

}

catch (SQLException e)

{

logInfo("Connection Failed");

}

connection.close();

}

Page 74: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

74

Rational Functional Rational Functional TesterTester

Demo Session - 4Demo Session - 4

Advanced Scripting ApproachAdvanced Scripting Approach

Page 75: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

75

Agenda (Session - Agenda (Session - 4)4)

Best Practices

Architecture & Naming conversionSolution For Ambiguous Recognition

Usage of Swing in RFTTable value selection & verificationMultiple Object Recognition with reference of single object or table properties.

Exception handlingDB Migration Testing Approach (In iCargo)Manual & Dynamic Verification Point

Test Object handling & Optimization Technique

Page 76: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

76

Automation ApproachAutomation Approach

Well Defined Testing Goal / business Scenario improve the Test Automation

Development plan / Resource Plan / Common understandable Naming conversion

* At least one developer should be in the team

Manual Practice mandatory before scripting, this help us to segregate the component level scripting activity , improve re-usability of script and optimized scripting approach.

Page 77: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

77

RFT Architecture Approach in iCargo RFT Architecture Approach in iCargo

Supporting Scripts

Logical / Non-screen related Scripts

Class

Common Data pool

Common Test Objects

MenuModule Level

Screen LevelComponent Level

Common ScriptsTest Suit (integrated

scenario)

Page 78: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

78

Solution For Ambiguous Solution For Ambiguous RecognitionRecognition

public void testMain(Object[] args) {

sleep(2);ITestObjectMethodState testobjmethodstate = null;RootTestObject roottestobj = getRootTestObject();

TestObject[] testobj=roottestobj.find(atList(atDescendant(".class","Html.HtmlBrowser")));

int noofbrowsers=testobj.length;int[] intarr=new int[100]; for(int b=0;b<noofbrowsers;b++)

{intarr[b]=b;

}for(int b=0;b<noofbrowsers;b++)browser_htmlBrowser(testobj[b],DEFAULT_FLAGS).close();System.out.println("No.of Closed IE"+testobj.length);sleep(2);

}

Page 79: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

79

Swings In RFTSwings In RFT

We are using swings for some exception handling at run, time

Adequate dataset up in the absence of base data in new DB in runtime

Supporting for data migration test

Page 80: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

80

public void testMain(Object[] args)

{

JFrame frame =new JFrame();

Object[] billingperiod = {"Weekly", "Monthly", "Bi-Monthly"};

//Pop-up input data

String billperiod = (String)JOptionPane.showInputDialog(frame,"Select The Billing Period ",

"Customized Dialog",JOptionPane.PLAIN_MESSAGE,null,billingperiod,"Weekly");

// Add Connection class here

try

{

//Insert into SHRAGTSETCUR

// ADD Table Insert Scripts here....

}

catch(Exception e)

{

System.out.println(e);

}

}

Page 81: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

81

Object – New approachObject – New approach

Object can be identify with out recording , by understanding the object property

public void testMain(Object[] args) {RootTestObject roottestobj=getRootTestObject();TestObject[] usrname=roottestobj.find(atList(atDescendant(".class","Html.INPUT.text",".name","username")));System.out.println(usrname.length);for(int i=0;i<usrname.length;i++){System.out.println(usrname[i].getProperties());// Identify through object map text_username(usrname[i]),LOADING).setText(“Vijay”);//Identify through object property ,never required object capture or recording...usrname[i].setProperty(".value", "AKLARL");

}

}

Page 82: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

82

Identify Specific Value from Table / enable check box at Identify Specific Value from Table / enable check box at appropriate valuesappropriate values

public void testMain(Object[] args) {ITestDataTable breakdownTable = (ITestDataTable)table_stationAllotment().getTestData("contents");int r=breakdownTable.getRowCount();int c=breakdownTable.getColumnCount();int clickRow = 0;int clickCol = 0;for(int row = 0;row < r; row++){for(int col = 0;col < c; col++){ if(breakdownTable.getCell(row,col)!= null){ if(breakdownTable.getCell(row,col).toString().trim().equalsIgnoreCase((valueof.said1).trim())){clickRow = row; clickCol = col; break;} } } }table_stationAllotment().click(atCell(atRow(atIndex(clickRow)), atColumn(atIndex(clickCol))));}}

Page 83: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

83

External File Read and Write External File Read and Write Class Class

public class rw {String retrICAR;File currDir = new File("fsrw-read&wrirefiles");String filepath = currDir.getAbsolutePath().trim();//Function for writing to the file, public void writeF(String newICAR,String fname) { FileWriter fw; try { fw = new FileWriter(filepath+"\\"+fname); fw.write(newICAR); fw.close(); } catch (IOException e){ }}// function for Reading from the file.public String readF(String fname) {try {BufferedReader br = new BufferedReader(new FileReader(filepath+"\\"+fname));retrICAR = br.readLine();System.out.println(retrICAR);br.close();} catch (IOException e1){}return retrICAR;}}

Page 84: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

84

External File Read and Write Class Usage in the External File Read and Write Class Usage in the scriptscript

public void testMain(Object[] args) {FSRW.rw a=new FSRW.rw();//Write in to text filea.writeF("Myname", "name.txt");//Read From text fileString NameID= a.readF("name.txt").trim();String NameID1= a.readF("name.txt").substring(0,3).trim();}

Page 85: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

85

public void testMain(Object[] args) {boolean NewAWB;boolean errormsg;boolean othrmsg;NewAWB = html_msgDataSpn().exists();errormsg = image_errorMessage().exists();while ( ! NewAWB || errormsg ){ if (!errormsg) { System.out.println("AWB already Captured"); button_clearbutton(ANY,LOADING).click(); } else if (errormsg) { System.out.println("Found Error message"); image_errorMessage().click(); button_clearbutton(ANY,LOADING).click(); }} System.out.println("New AWB"); button_yesbutton().click(); }}

Simple Exception handling for Expected run time Simple Exception handling for Expected run time application error Message !application error Message !

Page 86: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

86

&Q U E S T I O N SQ U E S T I O N SA N S W E R SA N S W E R S

Page 87: Rational Functional Tester - upload

<Title of the Presentation> TRAINING

December 16, 2006

IBS Software Services Pvt LtdCopyright © IBS Software Services. All Rights Reserved

87

Thank YouThank You