Discussion Forum

Welcome to the Discussion Forum, we encourage you to REGISTER on our forum and participate in the debate.For more details Click here

Online Advertising

Viewers now you can promote Your Websites/Blogs/Products by using our online advertising program.Using this feature you can place your Ads in my blog and can attract the people logging over here.To place your ads, just sign in my Guest Book and leave your details over there.

Thursday, June 11, 2009

Text Verification script in OpenSTA

Consider that we need to check whether the particular page gets loaded while executing the application under test by OpenSTA..
For the above scenario let us derive a script,
Place the following code below the url where we would like to verify the text,
SET VER_STRING = "Your Search Text goes here"
LOAD RESPONSE_INFO BODY ON 2 INTO VER_BODY
Log VER_BODY
!HTML response body content will be stored in the above variable.
SET VER_LOCATION = ~LOCATE (VER_STRING,VER_BODY), CASE_BLIND
!Location of the string you searched will be stored in the above variable.
SET L2 = ~EXTRACT(VER_LOCATION, 62, VER_BODY)
Log L2
!Text searched for verification will be stored in the above variable.
IF (VER_LOCATION >= 0) THEN
LOG "Verification SUCCES - Page contained the string '", VER_STRING , "'"
ELSE
LOG "Verification FAILED - Page did not contain the string '", VER_STRING , "'"
ENDIF

Note:
2 refers to Connection Id and
62 refers to the length of yor search string.

3 comments:

vijju said...
This comment has been removed by the author.
vijju said...

How to check if the page loaded is pdf, is it the same procedure??

Arulraj said...

vijju thanks for dropping your comment, can u plz ellaborate your question....

Post a Comment

Free advertising


Lowes Coupon
How to Blog

Free Advertising