Saturday, June 21, 2008

Script for Data Driven test with Rational Robot's Datapool.

'The script can be used or modified as needed after creating appropriate Datapool in Rational Robot.

'$include "sqautil.sbh"

Sub Main

Dim Result As Integer
DIM dp_result as long
'DIM dp_result as long
Dim dp_agentName as string
Dim dp_password as string
Dim dp_fetchResult as long
Dim dp_result1 as long
Dim dp_flight as long

'Script Name: dataPoolLogin


FOR I=1 TO 2
dp_Fetchresult = SQADatapoolFetch(dp_flight)
Window SetContext, "Class=Shell_TrayWnd", ""
Toolbar Click, "Text=Quick Launch;\;ItemText=Flight", "Coords=16,8"

Window SetContext, "Caption=Login", ""
EditBox Click, "ObjectIndex=1", "Coords=7,8"
dp_result = SQADatapoolValue(dp_flight,1,dp_agentName)
' InputKeys "mercury"
InputKeys dp_agentName

EditBox Click, "ObjectIndex=2", "Coords=10,2"
dp_result1 = SQADatapoolValue(dp_flight,2,dp_password)
'InputEncKeys "CAAAAM4AAAAICaEYwet4JA=="
InputKeys dp_password
PushButton Click, "Text=OK"

' closing flight reservation
Window SetContext, "Caption=Flight Reservation", ""
Window Click, "", "Coords=39,-34"
MenuSelect "File->Exit"


End Sub

1 comment:

Please, do write your comment on the read information. Thank you.