IBM Support

How to call a Rational Functional Tester script from a regular Java project

Question & Answer


Question

How can you call an IBM® Rational® Functional Tester (RFT) script from a regular Java™ project?

Cause

You want to add functions to your non-RFT Java project and re-use RFT code.

Answer

You cannot call an RFT class like you would do for any Java program.

An RFT project differs from a regular Java program. Therefore it is not enough to call a class like you would do for any Java program. Using callscript does not call the RFT script.

You can try to call the RFT script from a Java project with the following steps.

    1. Create a simple Java project.

    2. Create a sample class. Below is the code for this class.

    3. Add the rational_ft.jar file in the Java project classpath, the Java build path. The JAR's default location is:

      C:\Program Files\IBM\SDP70\FunctionalTester\bin

    4. Modify the location of your RFT script. Now you can call an RFT script from this Java class.


Disclaimer

All source code and/or binaries attached to this document are referred to here as "the Program". IBM is not providing program services of any kind for the Program. IBM is providing the Program on an "AS IS" basis without warranty of any kind. IBM WILL NOT BE LIABLE FOR ANY ACTUAL, DIRECT, SPECIAL, INCIDENTAL, OR INDIRECT DAMAGES OR FOR ANY ECONOMIC CONSEQUENTIAL DAMAGES (INCLUDING LOST PROFITS OR SAVINGS), EVEN IF IBM, OR ITS RESELLER, HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.





public class ExternalClassforRFT {

public static void main(String[] args) {
String rftplaybackArgs[] = new String[]{"-datastore", "C:\\Testmanager\\RemoteTesting\\DataPoolTesting", "-playback", "DataPoolTest"};

try
{
Thread.sleep(100);
}catch (Exception e){}

System.out.println("I got .. + " + rftplaybackArgs.toString());
// TODO Auto-generated method stub
com.rational.test.ft.rational_ft.main(rftplaybackArgs);
}
}

[{"Product":{"code":"SSJMXE","label":"IBM Rational Functional Tester"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Eclipse","Platform":[{"code":"PF033","label":"Windows"}],"Version":"6.1;6.1.0.1;6.1.1;6.1.1.1;7.0;7.0.0.1;7.0.0.2;7.0.1;7.0.1.1;7.0.1.2;7.0.1.3;8.0;8.0.0.1;8.0.0.2;8.0.0.3;8.1;8.1.0.1;8.1.0.2;8.1.0.3;8.1.1;8.1.1.1;8.1.1.2;8.1.1.3;8.2;8.2.0.1;8.2.0.2;8.2.1;8.2.1.1;8.2.2","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
16 June 2018

UID

swg21306251