Quick Notes About RFT (Rational Functional Tester)
0 comments Published by adel on Saturday, March 01, 2008 at 2:13 PMGood Things about RFT:
- Flexibility in terms of full access to object properties, controlling those properties in a very meticulous way which gives the ability to override unwanted recognition errors and increase application's immunity to changes in your AUT that should not be considered as fails. RFT is doing great here
- Since it works under eclipse, you have virtually unlimited ability to integrate useful java classes that recording and playback cannot do. Such as database accessibility, necessary looping and switching and even adding a nice sleeky UI.
Concerns about RFT:
- Unexpected crashes of the framework. This happened three times in less than 8 months. It happens in response to an eclipse update.
- Eclipse version effect on new scripts: New Scripts may not run until eclipse is update.
- Competition with other products such as QTP and open source tools such as Selenium and Selenium grid, which i am starting to like more and more.
- Flash and Flex plug-ins. Flash and flex support is available only in version 7 and above. My version is 6.1. Why isn't there a plug-in to support this?!
Enhance IBM Rational Functional Tester (RFT) with U.I Java Classes
5 comments Published by adel on Saturday, February 23, 2008 at 2:27 PMDisclaimer: This post is related to IBM Rational Functional Tester With Java. It needs some slight modifications to work with other tools.
Sometimes, your automated test script needs to do some strange stuff. Like accessing the database, extracting some value and using this value in subsequent U.I steps in your script.
Suppose that you have hundreds of scripts that needs the following block to access the DB and read a certain value:
try{What if the username and password is changed after a period of time for a certain reason. This means that you need to modify all your scripts and change the credentials. And this could be a pain and very time consuming.
Connection db_connection = DriverManager.getConnection("jdbc:odbc:DBNAME",
"username","password");
Statement stm2 = db_connection.createStatement();
stm2.executeQuery("select * from TableName");
}
catch( SQLException x ){
JOptionPane.showMessageDialog(null,
x.getLocalizedMessage().toString(),"Error",
JOptionPane.ERROR_MESSAGE);
}
A good practice is creating a class that will prompt the user to enter the credentials and validates them before running the script. This will save time and headache in subsequent releases.
The following is the code for the class with the proprietary information removed:
import javax.swing.JOptionPane;
import resources.SendValidUNandPWHelper;
import com.rational.test.ft.*;
import com.rational.test.ft.object.interfaces.*;
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.*;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;
/**
* Description : Functional Test Script
* @author Ashehadeh
*/
class SendValidUNandPW extends SendValidUNandPWHelper
{
/**
* Script Name : CheckDBDialog
* Generated : Feb 19, 2008 8:31:06 AM
* Description : Functional Test Script
* Original Host : WinNT Version 5.1 Build 2600 (S)
*
* @since 2008/02/19
* @author Ashehadeh
*/
/**
* @param args
*/
public String[] sendValidCredentials(){
String[] result=null;
String[] k =validateInput();
while (k==null){
k= validateInput();
}
return k;
}
//check if the provided credential can access the DB
public static String[] validateInput(){
String[] result=null;
String[] k =isDBonline();
if (k==null){
result =null;
System.exit(0);
}
else {
try{
Connection db_connection = DriverManager.getConnection("jdbc:odbc:DBNAME",k[0],k[1]);
Statement stm2 = db_connection.createStatement();
stm2.executeQuery("select * from TABLEName");
result =k;
}
catch( SQLException x ){
JOptionPane.showMessageDialog(null,
"Please Enter correct Uasername/Password!","Error",
JOptionPane.ERROR_MESSAGE);
/* JOptionPane.showMessageDialog(null,
x.getLocalizedMessage().toString(),"Error",
JOptionPane.ERROR_MESSAGE);*/
result=null;
}
}
return result;
}
//check if the db is online from the first place
public static String[] isDBonline(){
String[] result=null;
String[] k =isOneEmpty();
if (k==null){
result =null;
System.exit(0);
}
//now check for DB connectivity
else {
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
result =k;
}
catch(ClassNotFoundException c){
JOptionPane.showMessageDialog(null,
"DB Unavailable!","Error",
JOptionPane.ERROR_MESSAGE);
result=null;
System.exit(0);
}
}
return result;
}
//is one of the fields empty? if so, exit
public static String[] isOneEmpty(){
String[] k=showDialog();
String[] result;
// if one of the username or passwords are empty, exit.
if (k[0]==null || k[1].equals("") ||
k[1].equals("") || k[1]==null){
JOptionPane.showMessageDialog(null,
"Error. Fill the two fields. Click ok to exit!","Error",
JOptionPane.ERROR_MESSAGE);
result=null;
System.exit(0);
}
//if both of them are not empty continue
else{
result=k;
}
return result;
}
//prompt the user for username and password
public static String[] showDialog() {
String DBUsername=JOptionPane.showInputDialog(null,
"Enter DB username:", "Input", JOptionPane.QUESTION_MESSAGE);
String DBpassword=JOptionPane.showInputDialog(null,
"Enter DB password:", "Input", JOptionPane.QUESTION_MESSAGE);
String[] UPArray={DBUsername,DBpassword};
return UPArray;
}
}
getProperty and getPropertyFromMap methods in RFT
0 comments Published by adel on Thursday, October 18, 2007 at 3:04 PMI have encountered a problem while using RFT. I needed the script to capture a value of an object and stores it in a string. It turned out that getPropertyFromMap and getProperty work not exactly the same.
getProperty will capture the most recent property value of the specified object. While
getPropertyFromMap will capture the property value at the time the object was added to the map.
Connect Quantum DB to RFT for IBM Iseries
1 comments Published by Abu Gaby on Tuesday, August 28, 2007 at 10:35 AMWe are using RFT to test a terminal based application running on an IBM Iseries
machine.For certain testing scenarios we need to access the database from within then script.Here's how you do it (Note that we are running RFT version 6 and eclipse 3.0 ) :
1- Activate RFT
2- Go To “Help” in the menu bar choose “Software Updates” then choose “find and install”.
3- Then choose “Search for new features to install and press next”.
4- Press on “New Remote Site” in the name type “Eclipse Update” and in the URL put this URL http://update.eclipse.org/updates/3.0/.
5- Do step 4 again and in the name type “Quantum” and in the URL put http://quantum.sourceforge.net/update-site.
6- Check them both and press the next button.
7- Install all the “GEF” and “Graphical Editing Framework” and the “Graphical Editing Framework SDK” that doesn’t produce dependencies error.
8- Install All the Quantum features
9- After you have completed the above steps open windows control panel à administrative tools à Data Sources (ODBC) .
10- In the System DSN tab, press on the add button, choose the iSeries Access ODBC Driver press finish.
11- In the Data Source Name type DB Name, then in the Server tab change the SQL Default Library to SLSQADATA and in the Packages Tab change the Package Library to SLSQADATA then press ok.
12- In the RFT go to the Windows menu in the menu bar à open perspective à others and choose Quantum DB.
13- When the Quantum Browser Loads press on the Add Bookmark.
14- Choose JDBC-ODBC Bridge press next and fill in the user id and password you use for your DB connection and in the Data Source field enter db name.
15- Press next and enter a name for the bookmark then press next leave the default choice of schema then click finish.
Now the connection is established between RFT and the Database Using a JDBC-ODBC bridge between the DB2 layer using the iSeries Navigator Driver and the RFT thus establishing the full connection.






