İstanbul evden eve nakliyat Beylikd¨¹z¨¹ evden eve nakliyat Tuzla evden eve nakliyat
Tutorial-16 How to pass parameters from one script to another by CallScript Method using IBM Rational Functional Tester-RFT
Delicious Bookmark this on Delicious
software testing genius

Tutorial-16 How to pass parameters from one script to another by CallScript Method using IBM Rational Functional Tester-RFT

Welcome to “Software Testing Genius”. Subscribe to my RSS feed for latest content on Software Testing.

Tutorial-16 How to pass parameters from one script to another by CallScript Method using IBM Rational Functional Tester-RFT

A suggestion of great value:

Before practicing these Tutorials on "Rational Functional Tester - IBM RFT", it is recommended that you acquire a preliminary working knowledge of using this wonderful tool - "Rational Functional Tester". This can be easily attained by careful study of the "Frequently Asked Questions – FAQ’s" brought to you by this web site for the first time by Clicking on the following link:


Learn the Basics of RFT through FAQ's

size=2>

<<<<<<<< =========== >>>>>>>>

This article presents a simple method of using the different signatures of the callScript method to pass data from one script to another using IBM RFT

The example uses two different Functional Tester scripts:

a) Script - 1: TheCaller, which calls another script and passes parameters

b) Script - 2: TheCalled, which receives the parameters and prints them to System.out

TheCaller script further uses three different versions of the callScript method:

Version - 1: Without additional parameters: This is the default usage of the callScript method, which will execute the specified script.

callScript("TheCalled");

Version - 2: With additional string array parameter: An array of strings is used to pass string parameters to the called script.

String[] dataToPass = new String[4];
...
callScript("TheCalled",dataToPass);

Version - 3: With additional object array parameter: An array of objects is used to pass different object type parameters to the called script.

Object[] objdataToPass = new Object[4];
...
callScript("TheCalled",objdataToPass);

The TheCaller script sample had been recorded as under:

import resources TheCallerHelper;
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.script.*;
import com.rational.test.ft.value.*;
import com.rational.test.ft.vp.*;
/**
* Description : Functional Test Script
* @author Administrator
*/
public class TheCaller extends TheCallerHelper
{
/**
* Script Name : TheCaller
* Generated : Feb 10, 2008 7:24:08 PM
* Description : Functional Test Script
* Original Host : WinNT Version 5.1 Build 2600 (S)
*
* @since 2008/02/10
* @author Administrator
*/
public void testMain (Object[] args)
{
callScript("TheCalled");
String[] dataToPass = new String[4];
dataToPass[0] = "this";
dataToPass[1] = "is";
dataToPass[2] = "really";
dataToPass[3] = "cool";
callScript("TheCalled",dataToPass);
Object[] objdataToPass = new Object[4];
objdataToPass[0] = new String("Thought the previous was cool?");
objdataToPass[1] = "Take this one!";
objdataToPass[2] = new Float(0.02);
objdataToPass[3] = new Integer(4711);
callScript("TheCalled",objdataToPass);
}
}
The TheCalled script uses a simple loop to print the received parameters to System.out:
import resources.TheCalledHelper;
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.script.*;
import com.rational.test.ft.value.*;
import com.rational.test.ft.vp.*;
/**
* Description : Functional Tester Script
* @author Administrator
*/
public class TheCalled extends TheCalledHelper
{
/**
* Script Name : TheCalled
* Generated : Feb 10, 2008 7:24:08 PM
* Description : Functional Test Script
* Original Host : WinNT Version 5.1 Build 2600 (S)
*
* @since 2008/02/10
* @author Administrator
*/
public void testMain (Object[] args)
{
if (args.length < 1)
{
System.out.println( "Expected at least 1 arg, however we got:
"+args.length);
return;
}
else
{
System.out.println( "Got: "+args.length+" args");
}
for (int i = 0; i < args.length; ++i)
{
System.out.println( " arg["+i+"] = "+args[i]);
}
}
}

Many More Tutorials on IBM RFT

Study Material - HP QTP & QC Certification Exam

Study Material - HP LoadRunner Certification Exam

Study Material - IBM RFT Certification Exam

What Successful Testers say about the Quality of this website

If you want to keep track of further articles on Software Testing,
I suggest you to subscribe my
RSS feed
.

You can also Subscribe by E-mail
and get All New articles delivered directly to your Inbox.

Full Study Material for Popular Certification Exams:

Largest Database of Sample Papers - 1000+ Unique Questions for ISTQB Foundation Exam

ISTQB Foundation Exam - Full Crash Course for Download

ISTQB Advanced CTAL Test Analysts Exam - Full Crash Course for Download


ISTQB Advanced CTAL Test Manager Exam - Full Crash Course for Download


Study Material - ISTQB Certification Exam

Consolidated Study Material - Testing & QA


Most Popular Topics in Demand:

Practical Roadmap to QTP Certification

Practical Roadmap to CSTE Certification

General HR Interview Questions Common For All 

Tricky HR Interview Questions Common For All
 

Rehearsal of QTP in 1 Hr. -  Interview Questions

 

Comments :

comments ↓


Leave Your Comments: (*) Marked Fields are Mandatory

You can apply basic formatting to the text

Name *
 
Email Address *
 
Website
 
Speak your mind
characters
sex hikayeleri