1.变量标识符固定为{},不能修改,并且不是类似loadrunner11那样的<>;
2.弹不出IE窗口,最大原因是因为IE版本过高,最好的IE版本为IE8;
3.判断JAVA 字符串是否为空,最好用 : str.length() == 0 ;
4.关联函数例子:web.reg_save_param("hc", new String []{"LB/IC=\\\"hc\\\":\\\"","RB/IC=\\\",","ORD=ALL","LAST"});
由于JAVA VUSER没有取关联值的函数,所以只能手动取,例如:
int len = Integer.valueOf(lr.eval_string("{hc_count}"));
for( int i = 0;i < len;i ++){
lr.eval_string("{hc_" + i + "}");
}
5.检查点函数例子:web.reg_find("Text/IC=\"code\":0", new String []{"LAST"});
6.发送POST请求例子:
web.submit_data("detail",
"Action=http://。。。。。。。,
new String[]{
"Method=POST",
"TargetFrame=",
"RecContentType=text/html",
"Referer=",
"Snapshot=t2.inf",
"Mode=HTML"},
new String[]{// "ITEMDATA", 不要加这条
"Name=ids", "Value=" + ids, "ENDITEM",
"Name=aid", "Value=" + detail_aid, "ENDITEM",
"Name=app_key", "Value=10155", "ENDITEM",
"Name=timestamp", detail_arr[0], "ENDITEM",
"Name=method", "Value=md5", "ENDITEM",
"Name=sign", detail_arr[1], "ENDITEM",
"LAST"});