Having problems with your account or logging in?
A lot of changes are happening in the community right now. Some may affect you. READ MORE HERE

How can I perform verification on the server response on BDF scripts recorded at TCP/IP level?

How can I perform verification on the server response on BDF scripts recorded at TCP/IP level?

You cannot perform automatic verification using the point and click method in the TrueLog Explorer in the same manner as you would when replaying HTTP traffic. Therefore when replaying a BDF Script which uses the SilkPerformer TCP/IP functionality you will instead have to manually incorporate verification into the BDF script.

One method of doing this is as follows:

1) Identify using the TrueLog Explorer "In-Data" tab the text that you wish to perform verification on to ensure that it is always returned by the server.

2) Modify the recorded function "WebTcpipRecvExact" so that the server response will be stored in a variable in memory; you can do this by removing the NULL value from the second parameter and replacing it with a variable as follows:

Recorded: WebTcpipRecvExact(hWeb0, NULL, 979); Amended: WebTcpipRecvExact(hWeb0, sVar, 979);

3) Perform a string search on the contents of the variable for the "text" that you wish to verify is returned by the server, you can do this by using one of the string search functions in the SilkPerformer BDL; like the following:

   nPos := StrSearch(sVar,"bea61home", STR_SEARCH_FIRST);
   Write (nPos);  Writeln;

4) If the string is not present in the server response you can then raise a verification error which will be written to the Results Repository by using the RepMessage function, as follows:

      if nPos 


In the above example I am checking to see if the position is less than 1, i.e it does not exist

Finally the whole segment of code should look like:

WebTcpipRecvExact(hWeb0, sVar, 979);
 
nPos := StrSearch(sVar,"bea61home", STR_SEARCH_FIRST);
Write (nPos);  Writeln;
 
if nPos 

DISCLAIMER:

Some content on Community Tips & Information pages is not officially supported by Micro Focus. Please refer to our Terms of Use for more detail.
Top Contributors
Version history
Revision #:
1 of 1
Last update:
‎2013-02-15 18:52
Updated by:
 
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.