Friday, February 11, 2011
Wednesday, February 9, 2011
Verification Point RFT
Verification points are used to compare the data or object properties verified dynamically or manually with the application.
Dynamic verification points
1. User can insert the verification point object under the "Verification Points."
2. Add the test object corresponding that object .
3. Add the following lines of code to verify the verification point dynamic.
Example : vpDynamic("DynamicVP_01", TestObjectHere()).performTest();
In IBM sources are mentioned below lines of code verify the dynamically. But when I ran this code, its displaying the error.
vpDynamic("DynamicVP_01").performTest();
Manual verification points
Note : I am not sure how manual verification points will work, when try for my application its displaying the error message .
Below information sources are copied from IBM site.
Manual verification points are useful when you create the data for the verification point yourself, and you want to compare the data. For example, the data could be the result of a calculation or could come from an external source, such as a spreadsheet, data pool, database, or custom calculation.
Using the vpManual method
vpManual
("Object_01", "Check something manually.").performTest();
// or
vpManual
("ManualVP_01", "Check something manually.",
"Check something manually.").performTest();
The first time that a manual verification point is executed, if the verification point object doesn't exist, the value passed in will become the baseline value (which you can then see and edit in Rational Functional Tester, just like any other verification point). Your log file will say: Created verification point baseline.
From that point forward, any subsequent call to vpManual for that verification point will compare the actual point with the point. As Listing 5 shows, you can also call vpManual by passing in both the baseline and the actual result. In this case, the verification point object in Rational Functional Tester is ignored.
Dynamic verification points
1. User can insert the verification point object under the "Verification Points."
2. Add the test object corresponding that object .
3. Add the following lines of code to verify the verification point dynamic.
Example : vpDynamic("DynamicVP_01", TestObjectHere()).performTest();
In IBM sources are mentioned below lines of code verify the dynamically. But when I ran this code, its displaying the error.
vpDynamic("DynamicVP_01").performTest();
Manual verification points
Note : I am not sure how manual verification points will work, when try for my application its displaying the error message .
Below information sources are copied from IBM site.
Manual verification points are useful when you create the data for the verification point yourself, and you want to compare the data. For example, the data could be the result of a calculation or could come from an external source, such as a spreadsheet, data pool, database, or custom calculation.
Using the vpManual method
vpManual
("Object_01", "Check something manually.").performTest();
// or
vpManual
("ManualVP_01", "Check something manually.",
"Check something manually.").performTest();
The first time that a manual verification point is executed, if the verification point object doesn't exist, the value passed in will become the baseline value (which you can then see and edit in Rational Functional Tester, just like any other verification point). Your log file will say: Created verification point baseline.
From that point forward, any subsequent call to vpManual for that verification point will compare the actual point with the point. As Listing 5 shows, you can also call vpManual by passing in both the baseline and the actual result. In this case, the verification point object in Rational Functional Tester is ignored.
DataPool in RFT
Data Pool:
Definition : Data Pool is like excel where user can keep data , sql queries and logs.
Create Data Pool :
User Can create two types of data Pool in IBM RFT.
1. Select "Test Data pool" from the File --->> New .
2. Select the Working folder to place data pool location.
3. Enter the Data Pool name of the file.
4. click the Next button.
5. If u want to create empty data pool then click finish button . otherwise if you want to import data from other sources like CSV .. then click the browse button to specify the location of that file.
6. Specify the delimiter or separator like comma or space or tab..
7. Click the finish button.
It will create the data pool under the selected working folder.
Private Data Pool:
When user planning to keep private data pool for that test script. He can add the private data pool in the "Script Explorer".
Right Click the Test Data Pool and Add "Associate Data pool".
Export the Data Pool:
User can export the data pool data as CSV file. Select the Export from file menu or right click the data pool and select the "export " option.
Specify the File name and select the File Separator . Click the Finish Button to export the data.
Read the Data pool Data:
public ArrayList ReadDP(String DpName, String ColumnName) {
ArrayList DpContent = new ArrayList();
java.io.File dpFile = new java.io.File(
(String) getOption(IOptionName.DATASTORE), DpName);
IDatapool dp = (IDatapool) dpFactory().load(dpFile, true);
//Use default iterator class
IDatapoolIterator dpIter = dpFactory().open(dp, null);
//Use default equivalence class
dpIter.dpInitialize(dp);
dpIter.dpReset();
while (!dpIter.dpDone()) {
// Insert actions using dpIter based references to the datapool
//Get the current datapool record
dpIter.dpCurrent();
//Get the String value at column index 0 in current record
String str = dpIter.dpString(ColumnName);
DpContent.add(str);
//Move the pointer to next record
dpIter.dpNext();
}
dpFactory().close(dpIter);
return DpContent;
}
Definition : Data Pool is like excel where user can keep data , sql queries and logs.
Create Data Pool :
User Can create two types of data Pool in IBM RFT.
1. Select "Test Data pool" from the File --->> New .
2. Select the Working folder to place data pool location.
3. Enter the Data Pool name of the file.
4. click the Next button.
5. If u want to create empty data pool then click finish button . otherwise if you want to import data from other sources like CSV .. then click the browse button to specify the location of that file.
6. Specify the delimiter or separator like comma or space or tab..
7. Click the finish button.
It will create the data pool under the selected working folder.
Private Data Pool:
When user planning to keep private data pool for that test script. He can add the private data pool in the "Script Explorer".
Right Click the Test Data Pool and Add "Associate Data pool".
Export the Data Pool:
User can export the data pool data as CSV file. Select the Export from file menu or right click the data pool and select the "export " option.
Specify the File name and select the File Separator . Click the Finish Button to export the data.
Read the Data pool Data:
public ArrayList ReadDP(String DpName, String ColumnName) {
ArrayList DpContent = new ArrayList();
java.io.File dpFile = new java.io.File(
(String) getOption(IOptionName.DATASTORE), DpName);
IDatapool dp = (IDatapool) dpFactory().load(dpFile, true);
//Use default iterator class
IDatapoolIterator dpIter = dpFactory().open(dp, null);
//Use default equivalence class
dpIter.dpInitialize(dp);
dpIter.dpReset();
while (!dpIter.dpDone()) {
// Insert actions using dpIter based references to the datapool
//Get the current datapool record
dpIter.dpCurrent();
//Get the String value at column index 0 in current record
String str = dpIter.dpString(ColumnName);
DpContent.add(str);
//Move the pointer to next record
dpIter.dpNext();
}
dpFactory().close(dpIter);
return DpContent;
}
Subscribe to:
Posts (Atom)
560 Free Online Courses
Top 200 universities launched 500 free online courses. Please find the list here .