web_reg_save_param_regexp does not capture string when using \n\t

  • KM00798834
  • 19-Mar-2014
  • 28-Jul-2016

Summary

How to correlate if there are invisible symbols (\t\r\n) in the response

Question

How to correlate if there are invisible symbols (\t\r\n) in the response?

Answer

Suppose the value you want to correlate in the following response section is “<PARAM NAME=HtmlFormIndex VALUE=0>”
<APPLET CODEBASE="/WebTours/classes/" CODE="FormDateUpdate.class" MAYSCRIPT Width=26 Height=28 BORDER=0>
<PARAM NAME=CalenderTitle VALUE="Select Departure Date">
<PARAM NAME=HtmlFormIndex VALUE=0>
<PARAM NAME=HtmlEditIndex VALUE=2>
<PARAM NAME=AutoClose VALUE=1>
<PARAM NAME=Label VALUE="...">
</APPLET>
The request is as below
web_url("reservations.pl",
"URL=http://localhost:1080/cgi-bin/reservations.pl?page=welcome",
"Resource=0",
"RecContentType=text/html",
"Referer=http://localhost:1080/cgi-bin/welcome.pl?page=search",
"Snapshot=t33.inf",
"Mode=HTTP",
LAST);
1 Go to the script folder and open t33.inf
2 find the response file which is the value of FileName1. (Eg: FileName1=t33.htm, the file is t33.htm).
3 Open t33.htm in Notepad++
4 Click view->Show symbol->Show all characters.
image text
5 Now you’re able to see invisible symbols.
image text
The meaning of these symbols are as below
CR=carriage return
LF=line feed
->=tab
.=blank
6 Use escape characters to escape them (\r for carriage return, \n for line feed, \t for tab) in the correlation functions
Here is an example to correlate “<PARAM NAME=HtmlFormIndex VALUE=0>”
web_reg_save_param_ex(
"ParamName=CorrelationParameter_1",
"LB=Select Departure Date\">\n   ",
"RB=\n   <PARAM",
SEARCH_FILTERS,
"Scope=Body",
LAST);