2

I am using IBm Rational Functional Tester(RFT)8.0.6 to automate my Java based HTML application. I am using commandline to launch RFT and my automation script and its launching properly but the only issue is its not able to read from the datapool. Note: This is working perfectly fine when I am running it from RFT directly. This is only happening when I try to run it from commandline.

Below are the error logs:


exception_name = com.rational.test.ft.DatapoolException
•exception_message = CRFCN0483E: Datapool file not found: Appconfigsuperclass\driver_testdata.csv
•script_name = Appconfigsuperclass.AppConfigDriverScript
•script_id = Appconfigsuperclass.AppConfigDriverScript.java
•line_number = 55
•exception_stack =  at com.rational.test.ft.datapool.DatapoolUtilities.loadCSV(DatapoolUtilities.java:127)
    at Appconfigsuperclass.Resuablemethods.import_csv_datapool(Resuablemethods.java:71)
    at Appconfigsupe`enter code here`rclass.AppConfigDriverScript.testMain(AppConfigDriverScript.java:55)
    at org.eclipse.equinox.internal.app.EclipseAppContainer.callMethodWithException(EclipseAppContainer.java:587)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:198)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1414)
    at org.eclipse.core.launcher.Main.main(Main.java:34)

My batch file has the below content:

set PATH=%PATH%;C:\Program Files (x86)\Java\jdk1.7.0_03\bin
cd C:\Program Files (x86)\IBM\SDP\FunctionalTester\bin
java -jar rational_ft.jar -datastore "C:\Users\a554431\automationworkspace\Project1" -playback "Appconfigsuperclass.AppConfigDriverScript" -language java -log "test"

Appreciate your help.

user5252179
  • 133
  • 3
  • 20

1 Answers1

0

I think the path of file( Appconfigsuperclass\driver_testdata.csv) being used is relative to the current directory , which in case of IDE is the project directory. If you add a check as follows:

File f = new File("<path of csv>");
Boolean exists = f.exists();
if(exists)
     DatapoolUtilities.loadCSV(f);
else
    System.out.println("Error!! CSV file to load  , not found!!");

I think you should see the error that csv file not found.

If you do then you should pass the absolute path of the CSV file and that should take care of the issue.

Prakash
  • 742
  • 7
  • 19
  • Thanks for the response. This morning when I tried running it without changing anything it ran fine without any "Datapool file not found "error . This is wierd. I was about to try with absolute path of the file and was wondering why is this difference between running from command line and from RFT but luckily it worked. Not sure why was that error thrown initially. I have seen several times such inconsistent issues in RFT which comes once and is not replicable again:( – user5252179 Sep 14 '15 at 13:37
  • This issue should not be insonsistent. What might have changed in your scenario is the location from where you are executing the script ..i.e the current directory. In case of IDE the project directory is the project directory and hence there should be no issues resolving the relative path . In case of Command Line Interface depending on what is the directory you are executing the commandline from , it may or may not resolve the path . To find out the current dir you can print getProperty("user.dir") and see what does it print in Commandline and IDE. – Prakash Sep 15 '15 at 05:53