|
web_reg_save_param("RequestId17",
"LB=name='__dmfRequestId' value='",
"RB='>",
"Ord=1",
"RelFrameId=1",
"Search=Body",
LAST);
web_reg_find("Text=ACTIVE",
"Search=body",
LAST);
web_submit_data("greet.jsp",
"Action=https://branchautomationuat.singaporeconsumer.citigroup.net/webtop_goldenvision/custom/jsp/greet/greet.jsp",
"Method=POST",
"RecContentType=text/html",
"Referer=https://branchautomationuat.singaporeconsumer.citigroup.net/webtop_goldenvision/custom/jsp/welcome/welcome.jsp",
"Snapshot=t16.inf",
"Mode=HTML",
ITEMDATA,
"Name=__dmfFormId", "Value=Greet_0", ENDITEM,
"Name=__dmfAction", "Value=Greet_0_populateTaskGrid", ENDITEM,
"Name=__dmfHandler", "Value=Greet_0_Greet_0", ENDITEM,
"Name=__dmfHandlerArgs", "Value=Greet_0_", ENDITEM,
"Name=__dmfControl", "Value=", ENDITEM,
"Name=__dmfServletPath", "Value=/custom/jsp/greet/greet.jsp", ENDITEM,
"Name=Greet_ddl_gre_search_0", "Value=NRIC", ENDITEM,
"Name=Greet_txt_gre_key_0", "Value={NRIC}", ENDITEM,
"Name=__dmfRequestId", "Value={RequestId14}", ENDITEM,
"Name=__dmfHiddenX", "Value=0", ENDITEM,
"Name=__dmfHiddenY", "Value=0", ENDITEM,
"Name=__dmfFormclass", "Value=com.citibank.northstar.components.greetcomponents.Greet", ENDITEM,
"Name=__dmfNlsclass", "Value=com.citibank.northstar.greetNlsProp", ENDITEM,
"Name=__dmfInitDocbase", "Value=", ENDITEM,
"Name=__dmfInitDocbaseUser", "Value=", ENDITEM,
"Name=__dmfInitDocbasePassword", "Value=", ENDITEM,
"Name=__dmfInitDocbaseDomain", "Value=", ENDITEM,
"Name=__dmfInitLocale", "Value=", ENDITEM,
"Name=__dmfSerialNumber", "Value=7", ENDITEM,
"Name=__dmfClientId", "Value=_new", ENDITEM,
EXTRARES,
"URL=/webtop_goldenvision/custom/theme/citibank/icons/arrow-leftdarkgrey.gif", ENDITEM,
"URL=/webtop_goldenvision/custom/theme/citibank/icons/arrow-rightdarkgrey.gif", ENDITEM,
LAST);
上面是我在某项目中截取的一段代码.在某页面设置的字段检查点”ACTIVE”在controller并发测试时经常会找不到, 于是想加段代码以实现ACTIVE找不到时刷新一次submit请求,直到页面刷新出来找到”ACTIVE”字段为止.
上面关联的参数”RequestId#”会根据每次页面的刷新而递增.比如上面代码中如果ACTIVE找不到,再提交submit请求时,RequestID的Value就不能继续用{RequestID14}了,只能用新抓取的{RequestID17}来替代.其中{RequestID14}已经与上一层省略掉的页面关联.{RequestID17}本来是为下一个衔接的页面做的关联.请教高人如何编写脚本实现这种循环?
[ 本帖最后由 lingxdbc 于 2008-11-27 14:14 编辑 ] |
|