RahulRNair
Newbie
Reged: 01/20/12
Posts: 20
Loc: Thiruvananthapuram
|
|
Hi Friends, I am new to RFT, I just want to run my scripts as batch from command promt... Now i am trying to implement unattended tool run... Can any one send the exact code to invoke rft and run the scripts in from command prompt as batch... My project is in D:\projects Script is in D:\projects\unattended\unattended.java. Can any one help me to solve this issue..
-------------------- Rahul.R
|
dlai
Junior Member
Reged: 05/02/06
Posts: 1041
Loc: CA, USA
|
|
I'm currently working on this also. I currently have an ant script that does this. You can get the idea of how the command line argument looks like, it's basically running Java with all those arguments, it's best to use ant or maven to manage the dependencies.
Code:
<!-- Launch RFT test target --> <target name="testlauncher"> <property name="combined.class.path" value="${rational.jar};${other.thirdparty.libs.jar};"/> <java classpath="${combined.class.path}" fork="true" jvm="${rft.jvm.path}/bin/java.exe" classname="com.rational.test.ft.rational_ft">
<arg line='-datastore "${basedir}/debug/bin"' /> <arg line='-rt.bring_up_logviewer "false"' /> <arg line='-rt.interactive "false"' /> <arg line='-playback "testfolder.YourTestScript"' /> </java> </target>
I'm working on converting it into a Java executable with process control so I can kill RFT if the tool it freezes up during test execution.
Right now I'm having a hard time compiling it via commandline. I have the command for it, but since RFT lacks the ability to specify an output directory, it dumps the binaries in the same folder as the source. So right now I'm I'm compiling via eclipses with custom project settings, then running the test via ant. I like to bring the 2 under the same build script in the future, waiting on IBM to implement specifying an output dir.
-------------------- David Lai
Sr. QA / Test Lead
LinkedIn profile
Edited by dlai (01/23/12 08:19 AM)
|
RahulRNair
Newbie
Reged: 01/20/12
Posts: 20
Loc: Thiruvananthapuram
|
|
Thanks for your replay... I am feeling difficult to understand the code u had quoted since i am new to java as well as rft and ant concept. :-( ... Is any other easy method is there to run the script as batch?
-------------------- Rahul.R
|
dlai
Junior Member
Reged: 05/02/06
Posts: 1041
Loc: CA, USA
|
|
I think you're better off using ant (or maven) scripts. The command line really starts to look ugly.
My ant target executes something that looks like this...
C:\Program Files (x86)\IBM\SDP\jdk\jre\bin\java" -classpath "C:\Program Files (x86)\IBM\SDP\FunctionalTester\bin\rational_ft.jar;C:\Users\dlai\IBM\rationalsdp\workspace\MyProject\debug\bin\*;C:\Users\dlai\IBM\rationalsdp\workspace\MyProject\debug\bin\libs\*" "com.rational.test.ft.rational_ft" -datastore "C:\Users\dlai\IBM\rationalsdp\workspace\MyProject\debug\bin" -playback "testfolder.TestScript" -rt.bring_up_logviewer "false" -rt.interactive "false" LoginLogoutTest SomeTestParameters...
-------------------- David Lai
Sr. QA / Test Lead
LinkedIn profile
Edited by dlai (01/24/12 08:07 AM)
|
RahulRNair
Newbie
Reged: 01/20/12
Posts: 20
Loc: Thiruvananthapuram
|
|
Thank You dlai.
-------------------- Rahul.R
|
ruptan
Newbie
Reged: 09/03/09
Posts: 8
|
|
I have tried this and works great! C:\>java -classpath "C:\Program Files\IBM\SDP_1\FunctionalTester\bin\rational_ft.jar" com.rational.test.ft.rational_ft -datastore "C:\Documents and Settings\YOURNAME\My Documents\RFT Scripts\FOLDER_NAME" -playback SCRIPT_NAME
|
RahulRNair
Newbie
Reged: 01/20/12
Posts: 20
Loc: Thiruvananthapuram
|
|
Hi ruptan, Still now its not working me,i am not sure whether what i have given is correct.I will share my workspace details.Please share the command
Folder Location D:MYSCRIPT Functional TestScript:D:MYSCRIPT\MYPROJECT Script to be executed:D:MYSCRIPT\MYPROJECT\MyFirstJavaScript.java Can u please help on this issue.
-------------------- Rahul.R
|
RahulRNair
Newbie
Reged: 01/20/12
Posts: 20
Loc: Thiruvananthapuram
|
|
Tried this way and is working fine!!!
@ECHO OFF :start :save_args_as_variables set RFT_PROJECT_LOCATION=D:\folder\folder("Workspace Location") set RFT_SCRIPT_NAME=scriptNew("script name without .java extension") set RFT_LOGFILE_NAME=foldername(folder where logs are written) goto check_args :check_args if "%RFT_PROJECT_LOCATION%" == "" goto missing_args if "%RFT_SCRIPT_NAME%" == "" goto missing_args if "%RFT_LOGFILE_NAME%" == "" goto missing_args goto args_ok :args_ok if "%4" == "silent" goto playback echo. echo RFT_PROJECT_LOCATION = %RFT_PROJECT_LOCATION% echo RFT_SCRIPT_NAME = %RFT_SCRIPT_NAME% echo RFT_LOGFILE_NAME = %RFT_LOGFILE_NAME% echo IBM_RATIONAL_RFT_ECLIPSE_DIR = %IBM_RATIONAL_RFT_ECLIPSE_DIR% echo IBM_RATIONAL_RFT_INSTALL_DIR = %IBM_RATIONAL_RFT_INSTALL_DIR% echo. echo Initializing RFT Playback...
layback java -classpath "D:\Applns\IBM\SDP\FunctionalTester\bin\rational_ft.jar" com.rational.test.ft.rational_ft -datastore %RFT_PROJECT_LOCATION% -playback %RFT_SCRIPT_NAME% if "%4" == "silent" goto end echo RFT playback complete. goto end :missing_args echo. echo ERROR: Invalid syntax! Usage: echo RFT_PlayScript ProjectPath ScriptName LogName [silent] goto end :end
-------------------- Rahul.R
|