9/13 Developing Siebel-Web Vuser Scripts

Siebel 我感觉还是挺不好录制的,能够直接成功很好,但是如果有问题以及想手动更改代码来更改一些操作还是挺麻烦的,我们现在先来看看里面比较重要的一些知识
Recording Options 以及 Run-Time settings都是默认的就好,注意用UTF-8好了
Sieble需要大量的correlation, 大部分可以使用默认的关联就可以了

我们现在看几个存在的关联
Function Correlation
In certain instances, the boundary match is a function. Functions generally use an array to store the run-time values. In order to correlate these values, VuGen parses the array and saves each argument to a separate parameter using the following format:
<parameter_name> = <recorded_value> (display_name)
The display name is the text that appears next to the value, in the Siebel Application.
这个就是说使用数组来存储run-time values, 从server端发送来的是一个固定格式的串,我们用不同的变量来标示不同的值,在脚本中我们也常看到类似下面的注释
VuGen inserts a comment block with all of the parameter definitions.
/* Registering parameter(s) from source task id 159
// {Siebel_Star_Array_Op33_7} = ""
// {Siebel_Star_Array_Op33_6} = "1-231"
// {Siebel_Star_Array_Op33_2} = ""
// {Siebel_Star_Array_Op33_8} = "Opportunity"
// {Siebel_Star_Array_Op33_5} = "06/26/2003 19:55:23"
// {Siebel_Star_Array_Op33_4} = "06/26/2003 19:55:23"
// {Siebel_Star_Array_Op33_3} = ""
// {Siebel_Star_Array_Op33_1} = "test camp"
// {Siebel_Star_Array_Op33_9} = ""
// {Siebel_Star_Array_Op33_rowid} = "1-6F"
// */

In addition, when encountering a function, VuGen generates a new parameter for web_reg_save_param, AutoCorrelationFunction. VuGen also
determines the prefix of the parameters and uses it as the parameter name. In the following example, the prefix is Siebel_Star_Array_Op33.

web_reg_save_param("Siebel_Star_Array_Op33",
"LB/IC=`v`",
"RB/IC=`",
"Ord=1",
"Search=Body",
"RelFrameId=1",
"AutoCorrelationFunction=flCorrelationCallbackParseStarArray",
LAST);
注意上面只是Siebel_Star_Array_Op33,这样就用这个来获得了该数组里面所有的值,submit数据的时候就是每一个元素的值了,例如:
Siebel_Star_Array_Op33_1

SWEC Correlation
SWEC is a parameter used by Siebel servers representing the number of user clicks. The SWEC parameter usually appears as an argument of a URL or a POST statement.
VuGen handles the changes of the SWEC by incrementing a counter before each relevant step. VuGen stores the current value of the SWEC in a separate variable (Siebel_SWECount_var ). Before each step, VuGen saves the counter’s value to a VuGen parameter (Siebel_SWECount).
In the following example, web_submit_data uses the dynamic value of the SWEC parameter, Siebel_SWECount.
Siebel_SWECount_var += 1; //这个可能就是用户clicks的数目
lr_save_int(Siebel_SWECount_var, "Siebel_SWECount"); //把
Siebel_SWECount_var的值存入Siebel_SWECount
web_submit_data(....
"Name=SWEC", "Value={Siebel_SWECount}", ENDITEM,
....
LAST);

SWECount

The SWECount parameter value is usually a small number consisting of one or two digits. It is often difficult to determine where to replace the recorded value with a parameter.
In the web_submit_data function, VuGen only replaces it in the SWEC field.
In URLs, VuGen only replaces the value when it appears after the strings "SWEC=" or "SWEC`".
The parameter name for all the SWECount correlations is the same.

Row ID Length
In certain cases, the rowid is preceded by its length, encoded in hexadecimal format. Since this length can change, this value must be correlated.
For example, the following string is comprised of a length value and RowID, xxx6_1-4ABCyyy, where 6 is the length, and 1-4ABC is the RowID.
If you define parameters to correlate the string as xxx{rowid_Length}_{rowid}yyy then using this enhanced correlation, VuGen generates the following function before the string:
web_save_param_length("rowid", LAST);
This function gets the value of rowid, and saves its length into the parameter rowid_length in hexadecimal format.

SWETS (Timestamps)
The SWETS value in the script, is the number of milliseconds since midnight January 1st, 1970.
VuGen replaces all non-empty timestamps in the script, with the parameter {SiebelTimeStamp}. Before saving a value to this parameter, VuGen generates the following function:
web_save_timestamp_param("SiebelTimeStamp", LAST);
This function saves the current timestamp to the SiebelTimeStamp parameter.

上面这几个我们在siebel的脚本中很容易找到对应的例子,明天我在我的例子写上来,然后稍微分析一下,就比较清楚了

找个例子上来

 web_set_timeout(STEP, "1800"); \\设置timeout时间
 web_set_timeout(RECEIVE, "1800");\\设置timeout时间
 web_set_max_html_param_len("10240");\\设置变量的最大长度,由于可能关联的值占用很多字节,所以我们设置一个比较大的值
web_reg_save_param("Siebel_sn_cookie3",
  "LB/IC=_sn=",
  "RB/IC=;",
  "Ord=1",
  "Search=headers",
  "RelFrameId=1",
  LAST);
web_url(...);
 Siebel_SWECount_var = 0;
 lr_save_int(Siebel_SWECount_var, "Siebel_SWECount");
web_save_timestamp_param("SiebelTimeStamp",   LAST);
web_submit_data(.....,
"Name=_sn", "Value={Siebel_sn_cookie3}", ENDITEM,
  "Name=SWEC", "Value={Siebel_SWECount}", ENDITEM,
  "Name=SWEW", "Value=", ENDITEM,
  "Name=SWEBID", "Value=-1", ENDITEM,
  "Name=SWETS", "Value={SiebelTimeStamp}", ENDITEM,
....
LAST);

对于用户按键这个变量我还是很不理解,不知道为什么增加,而且增加多少也不清楚,唉,这个还得慢慢研究



posted on 2007-09-14 00:02  RobinGe  阅读(991)  评论(0编辑  收藏  举报

导航