Wednesday, November 21, 2007

Mutiple Parametrisation in Opensta (Performance testing tool)

Parameterization

It includes passing different types of data into the application to emulate the real world users performing/entering different values.

The Source Code for Parametrisation in Opensta


CHARACTER*512 UserName ,LOCAL
CHARACTER*512 USRNAM, FILE ="USRNAM", SCRIPT
…………………..
Declare all the required paramters -

!Read in the default browser user agent field
Entry[USER_AGENT,USE_PAGE_TIMERS]

ACQUIRE MUTEX "USRNAM"
NEXT USRNAM
SET UserName=USRNAM
RELEASE MUTEX "USRNAM"

SET USE_PAGE_TIMERS = 1

!LOG UserName
!INDUSER1,ChequePay*cheque+Payments#Pizzahut&Pizza+Hut+India@8

SET Length = ~LENGTH(UserName)

SET sep1 = ~LOCATE(',', UserName), CASE_BLIND
SET sep2 = ~LOCATE('*', UserName), CASE_BLIND
SET sep3 = ~LOCATE('#', UserName), CASE_BLIND
SET sep4 = ~LOCATE('&', UserName), CASE_BLIND
SET sep5 = ~LOCATE('@', UserName), CASE_BLIND

SET Offset1 = 0
SET Offset2 = sep1+1
SET Offset3 = sep2+1
SET Offset4 = sep3+1
SET Offset5 = sep4+1
SET Offset6 = sep5+1


SET Length1 = sep1
SET Length2 = (sep2 - 1) - Length1
SET Length3 = (sep3 - 1) - (Length1+Length2)-1
SET Length4 = (sep4 - 1) - (Length1+Length2+Length3)-2
SET Length5 = (sep5 - 1) - (Length1+Length2+Length3+Length4)-3
SET Length6 = Length - (sep5 - 1)





SET username = ~EXTRACT(Offset1, Length1, UserName)
SET product = ~EXTRACT(Offset2, Length2, UserName)
SET product_desc = ~EXTRACT(Offset3, Length3, UserName)
SET client = ~EXTRACT(Offset4, Length4, UserName)
SET client_desc = ~EXTRACT(Offset5, Length5, UserName)
SET micrnum = ~EXTRACT(Offset6, Length6, UserName)

LOG " Data Passed From File is ","" &
" username - ", username ,"" &
" product - ", product ," with product_desc " ,product_desc ,"" &
" client - ", client ," with client_desc " ,client_desc ,"" &
" micrnum - ", micrnum


IF ( ( username ="" ) OR (product = "") or (product_desc="") or (client="") or (client_desc = "") or (micrnum ="") ) THEN
LOG " Error in Passing Values Please Check Data File "
REPORT " Error in Passing Values Please Check Data File "
DETACH Thread
END IF

No comments: