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)
!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:
How to check if the page loaded is pdf, is it the same procedure??
vijju thanks for dropping your comment, can u plz ellaborate your question....
Post a Comment