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

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    Favorites, Groups & Events

    Tutorial - 16 : How to pass parameters from one script to another by CallScript Method using IBM RFT - Presentation Transcript

    1. Tutorial - 16 : How to pass parameters from one script to another by CallScript Method using IBM Rational Functional Tester - RFT 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
    2. */ 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) {
    3. System.out.println( " arg["+i+"] = "+args[i]); } } } Tutorial by : http://www.softwaretestinggenius.com
    SlideShare Zeitgeist 2009

    + Yogindernath GuptaYogindernath Gupta Nominate

    custom

    546 views, 0 favs, 0 embeds more stats

    How to pass parameters from one script to another b more

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 546
      • 546 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 19
    Most viewed embeds

    more

    All embeds

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories