The online community for software testing & quality assurance professionals
 
 
Calendar   Today's Topics
Sponsors:
Lost Password?

Home
BetaSoft
Blogs
Jobs
Training
News
Links
Downloads



Testing Tools >> IBM/Rational Functional Tester - RobotJ

Pages: 1
RahulRNair
Newbie


Reged: 01/20/12
Posts: 20
Loc: Thiruvananthapuram
How to run rft scripts from command promt as batch
      #696454 - 01/23/12 03:44 AM

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


Post Extras: Print Post   Remind Me!   Notify Moderator  
dlai
Junior Member


Reged: 05/02/06
Posts: 1041
Loc: CA, USA
Re: How to run rft scripts from command promt as batch [Re: RahulRNair]
      #696487 - 01/23/12 08:14 AM

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)


Post Extras: Print Post   Remind Me!   Notify Moderator  
RahulRNair
Newbie


Reged: 01/20/12
Posts: 20
Loc: Thiruvananthapuram
Re: How to run rft scripts from command promt as batch [Re: dlai]
      #696545 - 01/23/12 07:59 PM

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


Post Extras: Print Post   Remind Me!   Notify Moderator  
dlai
Junior Member


Reged: 05/02/06
Posts: 1041
Loc: CA, USA
Re: How to run rft scripts from command promt as batch [Re: RahulRNair]
      #696615 - 01/24/12 08:06 AM

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)


Post Extras: Print Post   Remind Me!   Notify Moderator  
RahulRNair
Newbie


Reged: 01/20/12
Posts: 20
Loc: Thiruvananthapuram
Re: How to run rft scripts from command promt as batch [Re: dlai]
      #701290 - 03/13/12 09:51 PM

Thank You dlai.

--------------------
Rahul.R


Post Extras: Print Post   Remind Me!   Notify Moderator  
ruptan
Newbie


Reged: 09/03/09
Posts: 8
Re: How to run rft scripts from command promt as batch [Re: RahulRNair]
      #704812 - 04/20/12 01:18 PM

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


Post Extras: Print Post   Remind Me!   Notify Moderator  
RahulRNair
Newbie


Reged: 01/20/12
Posts: 20
Loc: Thiruvananthapuram
Re: How to run rft scripts from command promt as batch [Re: ruptan]
      #705009 - 04/24/12 07:31 AM

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


Post Extras: Print Post   Remind Me!   Notify Moderator  
RahulRNair
Newbie


Reged: 01/20/12
Posts: 20
Loc: Thiruvananthapuram
Re: How to run rft scripts from command promt as batch [Re: RahulRNair]
      #706428 - 05/09/12 07:07 AM

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


Post Extras: Print Post   Remind Me!   Notify Moderator  
Pages: 1



Extra information
0 registered and 2 anonymous users are browsing this forum.

Moderator:  AJ, AllenGay 

Print Topic

Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is disabled
      UBBCode is enabled

Rating:
Topic views: 3457

Rate this topic

Jump to

Contact Us | Privacy statement SQAForums

Powered by UBB.threads™ 6.5.5