Cómo leer varias agrupaciones de datos desde un script de prueba funcional

Puede adaptar la API dynamic find() para leer varias agrupaciones de datos desde un script de prueba funcional.
Este código de ejemplo le muestra cómo leer más de una agrupación de datos desde un script de prueba funcional.
public class UserInformation extends UserInformationHelper {
	/**
	 * Script Name : UserInformation Generated : Sep 6, 2011 3:57:48
	 * PM Description : Functional Test Script Original Host : WinNT Version
	 * 5.1 Build 2600 (S)
	 * 
	 * @since 2011/09/06
	 * @author IBM Rational
	 */
	public void testMain(Object[] args) throws Exception {

		//User defined function to load more then on DataPool
		firstDataPool();
	}


	public void firstDataPool(){

		//Get a value from the first datapool at the Test Script Level.
		String address = dpString("Address");

		System.out.println(" -- Address from the 'script' associated dataPool: " + address);

		//Call the second datapool
		SecondDataPool();

	}

	public void SecondDataPool() {


		// Point to the datapool location that was created
		java.io.File dpFile = new java.io.File(
				(String) getOption(IOptionName.DATASTORE), "/UserDetails.rftdp");
		// Load the datapool using RFT IDataPoolFactory
		IDatapool dataPool_two = dpFactory().load(dpFile, true);

		// Open the datapool using RFT IDataPoolFactory
		IDatapoolIterator dataPool_Ite_2 = dpFactory().open(dataPool_two, null);

		// After it is opened, initilize the datapool to access the data
		dataPool_Ite_2.dpInitialize(dataPool_two);

		// Get a value from the second datapool, first record
		String firstName = dataPool_Ite_2.dpString("FirstName");

		// Redirect the output to console or use logInfo method
		System.out.println(" -- First Name from the Second DataPool: "
				+ firstName);
	}

}

Comentarios