Skip to main content

Loading Siebel Test Data Using IBM Rational Functional Tester

Robert Quinn (robquinn@us.ibm.com), Software Engineer, IBM
Robert Quinn is an IBM software engineer in the CRM Siebel Test group. His primary focus is Siebel software test automation. He can be reached at robquinn@us.ibm.com.

Summary:  See how IBM Rational Functional Tester can be used to create an automated data loading utility to support Siebel testing. This process makes loading large sets of test data on Siebel CRM systems more efficient and accurate.

Date:  11 Nov 2005 (Published 13 Apr 2005)
Level:  Introductory
Activity:  1264 views

Editor's Note: This article applies to IBM® Rational® Functional Tester versions 6.0 and 6.1.

In the Siebel test community large sets of data objects are frequently loaded on Siebel CRM systems to support test case execution. Since each Siebel release is tested on multiple geographic platforms, thousands of data objects are typically loaded into Siebel to support a test effort. Manual data entry is not efficient because it is time consuming and error prone. One solution to this problem is to extend the use of IBM Rational Functional Tester from an automated test scripting tool to an automated data loading tool. This article describes the creation of a data loading utility using Rational Functional Tester which makes the process of loading test data more efficient and accurate.

Designing test data objects and associated fields

The first step in constructing a Siebel data loading utility is to define test data objects and their associated fields. For example, a common data object used in Siebel testing is the user ID. Frequently, hundreds of user IDs need to be loaded on a Siebel system prior to testing. Each unique user ID has several fields associated with it which need to be populated in Siebel. These fields include: Login Name, First Name, Last Name, Responsibility and Position. To implement the data loading utility, create a spreadsheet containing the data associated with each test object. Save the spreadsheet in .csv file format so that it will be easy to parse later using Functional Tester. See Figure 1 as an example of a batch of user ID test objects saved in the spreadsheet userids.csv.


Figure 1. User ID test objects
Example of a batch of user ID test objects

Having captured the test data in a spreadsheet, define the algorithm required to load one instance of the data object in Siebel. Figure 2 is a screen shot of Siebel?s User Administration screen used to create new user IDs. This screen contains the five fields associated with the user ID data object.


Figure 2. Siebel's User Administration screen
Siebel's User Administration screen

An algorithm to create a single user ID in Siebel from this screen is:

  1. Click the new button to create a new record.
  2. Populate the Login Name field.
  3. Populate the First Name field.
  4. Populate the Last Name field.
  5. Populate the Responsibility field.
  6. Populate the Position field.

It is tedious and inefficient to manually repeat this process hundreds of times. Instead, we will automate the task using Functional Tester.


Implementation

Before writing code, we must create GUI objects in Functional Tester for each web component used in the algorithm. For the user ID example, we need the following GUI objects from Figure 2:

  • new button
  • Login Name text box
  • First Name text box
  • Last Name text box
  • Responsibility text box
  • Position text box

Start by creating an empty Functional Tester Script named UserIDs inside the appObjects folder of Functional Tester. Double click on the Private Test Object Map associated with the UserIDs script and insert the six GUI objects listed above using the Insert Object(s) icon. The GUI objects required to implement the algorithm are now in Functional Tester. You'll see the following code in the Functional Tester Script Explorer window:


Listing 1. UsersIDs.java
				
package appObjects;

import resources.appObjects.UserIDsHelper;
import ibm.widgets.*;
import ibm.widgets.ancestors.*;
import ibm.widgets.swt.*;

import com.rational.test.ft.*;
import com.rational.test.ft.object.interfaces.*;
import com.rational.test.ft.script.*;
import com.rational.test.ft.value.*;
import com.rational.test.ft.vp.*;

public class UserIDs extends UserIDsHelper {

	public WTextField getFirstName() {
		TestObject to = FirstName(ANY, NO_STATE);
		return new WTextField(to);
	}

	public WTextField getLastName() {
		TestObject to = LastName(ANY, NO_STATE);
		return new WTextField(to);
	}

	public WTextField getLoginName() {
		TestObject to = LoginName(ANY, NO_STATE);
		return new WTextField(to);
	}

	public WLink getNew() {
		TestObject to = New(ANY, NO_STATE);
		return new WLink(to);
	}

	public WTextField getPosition() {
		TestObject to = Position(ANY, NO_STATE);
		return new WTextField(to);
	}

	public WTextField getResponsibility() {
		TestObject to = Responsibility(ANY, NO_STATE);
		return new WTextField(to);
	}

	// --------------------------------------------------------------------------

	public void testMain (Object[] args) 
	{
		 // Unit testing can go here
		 // (will be deleted next time ClasGenerator is run)
	}
}

This data loading utility uses two java tasks. The first task, createUserID(),creates a single user ID in Siebel. The second task, processUserIDspreadsheet(), imports user ID data from the spreadsheet and sequentially loads it in Siebel using calls to createUserID().

Inside the tasks folder, create an Functional Tester Script named dataLoadTasks. Define the task createUserID() within this script (See Listing 2). This task is passed five parameters, representing the data used to populate each field of a user ID data object. The web components on the Siebel?s User Administration screen are accessed and populated via the GUI objects created above. Each GUI object is passed an input parameter which it uses to set the appropriate field of the Siebel?s User Administration screen. For example, inside the createUserID() task shown in Listing 2, the first line of code clicks the new button in Siebel to create a new user ID record. The next five lines set the desired data in Siebel.


Listing 2. dataLoadTasks.java
				
package tasks;
import ibm.util.FileOps;
import resources.tasks.dataLoadTasksHelper;

import com.rational.test.ft.*;
import com.rational.test.ft.object.interfaces.*;
import com.rational.test.ft.script.*;
import com.rational.test.ft.value.*;
import com.rational.test.ft.vp.*;

/**
 * Description   : XDE Tester Script
 * @author admin
 */
public class dataLoadTasks extends dataLoadTasksHelper
{
	/**
	 * Script Name   : dataLoadTasks
	 * Generated     : Mar 24, 2005 3:43:50 PM
	 * Description   : XDE Tester Script
	 * Original Host : WinNT Version 5.0  Build 2195 (Service Pack 4)
	 * 
	 * @since  2005/03/24
	 * @author admin
	 */
	
	
	public appObjects.UserIDs getUserIDs() {
		return new appObjects.UserIDs();
	}
	
	public void createUserID(String loginID, String firstName, 
					String lastName, String position, String responsibility) {
		getUserIDs().getNew().click();
		getUserIDs().getLastName().setText(lastName);
		getUserIDs().getFirstName().setText(firstName);
		getUserIDs().getLoginName().setText(loginID);
		getUserIDs().getResponsibility().setText(responsibility);
		getUserIDs().getPosition().setText(position);
		}

	public void processUserIDspreadsheet(String filepath) {

			String loginID, firstName, lastName, responsibility, position;
			String[] alist = FileOps.getFileContentsAsList(filepath);
			java.util.StringTokenizer st;
			int i = 1;
			
			while (i < alist.length) {
				st = new java.util.StringTokenizer(alist[i], ",");
				loginID = st.nextToken();
				firstName = st.nextToken();
				lastName = st.nextToken();
				responsibility = st.nextToken();
				position = st.nextToken();
				createUserID(loginID, firstName, lastName, responsibility, position);
				i = i + 1;
			} // end outer while
			
		}
	public void testMain (Object[] args) 
	{
       
	}
}

Next, define the task processUserIDspreadsheet() in the dataLoadTasks script as shown in Listing 2. This task receives a single parameter, the local path to the spreadsheet containing the data to be loaded. It reads the data spreadsheet and stores the lines of this file as a list of strings within Functional Tester. As seen in Listing 2, each line of the .csv file is parsed by extracting the strings between commas and saving them in tokens corresponding to the fields of each data object. The first token is associated with the Login Name field and the association continues until the last token is associated with the Position field. After a line is parsed the task createUserID() is called to load that data into Siebel. The process repeats until all the data in the spreadsheet has been processed.

Finally, create a script to launch the utility. Inside the tools folder, create an empty Functional Tester script named loadUserIDs. The code for loadUserIDs is found in Listing 3. This script simply calls the task processUserIDspreadsheet() with the path of the data spreadsheet as its parameter. The data loading utility is complete and can be launched from the loadUserIDs script.


Listing 3. loadUserIDs.java
				
package tools;

import tasks.*;
import resources.tools.loadUserIDsHelper;

import com.rational.test.ft.*;
import com.rational.test.ft.object.interfaces.*;
import com.rational.test.ft.script.*;
import com.rational.test.ft.value.*;
import com.rational.test.ft.vp.*;

/**
 * Description   : XDE Tester Script
 * @author Robert Quinn
 */
public class loadUserIDs extends loadUserIDsHelper
{
	/**
	 * Script Name   : loadUserIDs
	 * Generated     : Mar 24, 2005 3:44:37 PM
	 * Description   : XDE Tester Script
	 * Original Host : WinNT Version 5.0  Build 2195 (Service Pack 4)
	 * 
	 * @since  2005/03/24
	 * @author admin
	 */
	
	
	public void testMain (Object[] args) 
	{
        tasks.dataLoadTasks dt = new tasks.dataLoadTasks();
        dt.processUserIDspreadsheet("C:\\userids.csv");
	}
}


Summary

Large sets of data objects frequently need to be loaded on Siebel CRM systems to support testing activity. Manual data entry is inefficient because it is time consuming and inaccurate. The Siebel data loading utility described in this article extends the use of IBM?s Rational Functional Tester from an automated test scripting tool to an automated data loading tool. It represents an effective way to automate the process of loading test data thus making it more efficient and accurate.


Resources

About the author

Robert Quinn is an IBM software engineer in the CRM Siebel Test group. His primary focus is Siebel software test automation. He can be reached at robquinn@us.ibm.com.

Comments (Undergoing maintenance)



Trademarks  |  My developerWorks terms and conditions

Help: Update or add to My dW interests

What's this?

This little timesaver lets you update your My developerWorks profile with just one click! The general subject of this content (AIX and UNIX, Information Management, Lotus, Rational, Tivoli, WebSphere, Java, Linux, Open source, SOA and Web services, Web development, or XML) will be added to the interests section of your profile, if it's not there already. You only need to be logged in to My developerWorks.

And what's the point of adding your interests to your profile? That's how you find other users with the same interests as yours, and see what they're reading and contributing to the community. Your interests also help us recommend relevant developerWorks content to you.

View your My developerWorks profile

Return from help

Help: Remove from My dW interests

What's this?

Removing this interest does not alter your profile, but rather removes this piece of content from a list of all content for which you've indicated interest. In a future enhancement to My developerWorks, you'll be able to see a record of that content.

View your My developerWorks profile

Return from help

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Rational
ArticleID=59047
ArticleTitle=Loading Siebel Test Data Using IBM Rational Functional Tester
publish-date=11112005
author1-email=robquinn@us.ibm.com
author1-email-cc=rjbence@us.ibm.com

My developerWorks community

Tags

Help
Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere).

My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Use the search field to find all types of content in My developerWorks with that tag. Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere). My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Rate a product. Write a review.

Special offers