Still I’m in ma early days of ma work at virtusa, I’m working on a IBM Project and to start with I have been asked to write test scripts to automate IBM Information Server using RFT (Rational Functional Tester). Which really is an intersting frame work. As usual I have been playing around with it for almost two or three days just to get the grip over it. And now I think I’m in the driving seat.
The frame work can be used to test any web page or any software’s GUI(Graphical User Interface). I really don’t know the possibility of checking CLI’s with it. So it’s upto you to check on and if inform me if there’s a possibility to do that as well.
At the heart of RFT is three main components namely appobjects, tasks and test cases. Where as tasks can be further sub devided into two important catagories UIChecker and UIOperations.
As a starting point I thought of using ony appobjects and do a simple automation that will open up your browser, go to google and perform a search operation on it to automatically fetch you the results.
If you are too interested buddy in this like me, first thing would be to download IBM RFT of which you should be able download a trial copy free of charge, cool..! and then launch your RFT which will look quite the same as an eclipse IDE if you have worked on it. Now all wot you need to do now is to start your new Project and write click on your root folder and select Add Empty Script. which will give you the file you gonna work with. below I will share my first code that does what I have mentioned above.
But before you do that you have to capture the search button object on the google website. Which you can do by double clicking on Private Test Object Map on the right side panel of your RFT workspace. And select Insert Object in the resulting window. You just need to drag the hand marked button and point the button on the google site at this point please note that same applies to the text input field as well. Then you right click on the object and select add to TestScript.YourProject. That’s it now back to businees end of life..
package appobjects;
import resources.appobjects.GoogleProjectHelper;
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 HHameem
*/
public class GoogleProject extends GoogleProjectHelper
{
/**
* Script Name : <b>GoogleProject</b>
* Generated : <b>Jul 11, 2008 6:03:08 PM</b>
* Description : Functional Test Script
* Original Host : WinNT Version 5.1 Build 2600 (S)
*
* @since 2008/07/11
* @author HHameem
*/
public void testMain(Object[] args)
{
startBrowser(“http://www.google.com“);
text_q().setText(“Lonely Coder”);
button_googleSearchsubmit().click();
}
}
Now you will be getting the same results page exactly as the one you get when you search “Lonely Coder” on google(Which is obviously my favourite search criteria on Google) manually. Hope you will find it interesting.




Ashutosh Sharma said,
July 21, 2008 at 4:53 am
good Starter Tutorial.
Can you give some useful Java Test Script links for RFT or some tutorials with examples.
Regards,
Ashutosh Sharma
hamzeen said,
July 22, 2008 at 5:39 am
Well the best place for you to look for such a material would be the ibm site itself. Follow this link may find it useful for you.
http://www-128.ibm.com/developerworks/rational/library/06/0822_goel/
kaladher said,
August 6, 2008 at 7:29 am
hi,
can we directly do plugin RFT to Eclipse?
Can we write the script directly without capturing the objects?
if yes please let me know how? or how to write objects manually..
TIA
Pratik Dam said,
August 10, 2008 at 4:32 pm
Since you mentioned about CLI , I thought that I would share this with you ….
If you want to use a Telnet or SSH you can
try out one of these Freely available 3party libraries having Expect like behavour . Here is JEXPECT
Below is a sample snippet . .
JExpect exp = new JExpect(“expectJ.log”, 20);
String command = “telnet myhost”;
SpawnedProcess sp = exp.spawn(command);
sp.expect(“login”);
sp.send(“myhost\n”);
System.out.println(“Expect Status ” + sp.isLastExpectTimeOut());
if (sp.isLastExpectTimeOut()) {
System.err.println(“Did not match”);
System.exit(1);
}
sp.expect(“Password”);
sp.send(“mypass\n”);
sp.send(“rm /tmp/my.log\n”);
sp.interact();
System.out.println(“Started Interacting”);
sp.stop();
Another option would be to use another prog language libraries like Python
/TCL/Perl . Python is my language of choice and there is something called Jython which lets you use Java code from Python and Vice-Versa .
niranjan said,
August 14, 2009 at 11:07 am
Thanks alot !!!
I googled alot to find out the best way to automate telnet ..
This seems to best way on systems which do not have EXPECT/PERL/PYTHON…
Abhishek said,
December 24, 2008 at 6:47 am
Hi i am not able to inport sap and seibel on writing the below import
import com.rational.test.ft.object.interfaces.SAP.*;
import com.rational.test.ft.object.interfaces.siebel.*;
i get error as sap and seibel interfaces cannot be resolved…
does some1 has a solution…
Pujitha Pathirana said,
December 31, 2008 at 11:17 am
Hi,
This is really good for beginers. Thanks.
BTW have you or anyone tried RFT for automating Oracle Forms?
Ashutosh Sharma said,
January 30, 2009 at 6:55 am
Yes you can test Oracle Forms using RFT. for this you might need some proxy. Search for AppPoint proxy for RFT to test Oracle Application.
Regards,
Ashutosh Sharma
vikrant said,
March 6, 2009 at 8:18 am
Hi ,
I am new to RFT.I have got a script which is using following import statement
import ibm.tools.ClassGenerator.
Query:I do not have this ibm.tools.ClassGenerator !
Can you please tell me from where can I get this
sharad said,
March 16, 2009 at 4:09 am
hi can any one let me know how i can configure the oracle application in RFT.
from some post i just got below comments, it would be great if any one can give more details on the same.
“Yes you can test Oracle Forms using RFT. for this you might need some proxy. Search for AppPoint proxy for RFT to test Oracle Application.”
ophilia said,
June 23, 2009 at 12:20 pm
hi i had a doubt if we can use RFT for python scripts .Does RFT support python scripting??