1 测试积点
import com.thoughtworks.xstream.*;
import java.io.*;
import javaHttpJ.*;
import javaHttpJ.parsers.*;
import javaHttpJ.replay.*;
import lrapi.*;
public class Actions
{
public int init(){
return 0;
}
public int end(){return 0;}
public int action() throws Throwable{
String ENDFORM = "ENDFORM";
String LAST = "LAST";
String ENDITEM = "ENDITEM";
String ITEMDATA = "ITEMDATA";
String STARTHIDDENS = "STARTHIDDENS";
String ENDHIDDENS = "ENDHIDDENS";
String CONNECT = "CONNECT";
String RECEIVE = "RECEIVE";
String RESOLVE = "RESOLVE";
String REQUEST = "REQUEST";
String RESPONSE = "RESPONSE";
String EXTRARES = "EXTRARES";
int _webresult;
try{
lr.start_transaction("查看");
_webresult = lrapi.web.url("loading.gif",
"URL=http://192.168.0.120/oa/util/dialog/loading.gif", new String[]{
"Resource=1",
"RecContentType=image/gif",
"Referer=http://192.168.0.120/login/checkLoginAction.action",
"Snapshot=t17.inf",
LAST});
_webresult = lrapi.web.url("dialog.css",
"URL=http://192.168.0.120/oa/util/dialog/dialog.css", new String[]{
"Resource=1",
"RecContentType=text/css",
"Referer=http://192.168.0.120/login/checkLoginAction.action",
"Snapshot=t18.inf",
LAST});
_webresult = lrapi.web.url("title_bg_1.gif",
"URL=http://192.168.0.120/oa/util/dialog/title_bg_1.gif", new String[]{
"Resource=1",
"RecContentType=image/gif",
"Referer=http://192.168.0.120/login/checkLoginAction.action",
"Snapshot=t19.inf",
LAST});
_webresult = lrapi.web.url("tool_close.gif",
"URL=http://192.168.0.120/oa/util/dialog/tool_close.gif", new String[]{
"Resource=1",
"RecContentType=image/gif",
"Referer=http://192.168.0.120/login/checkLoginAction.action",
"Snapshot=t20.inf",
LAST});
_webresult = lrapi.web.url("EformAction.do",
"URL=http://192.168.0.120/oa/EformAction.do?actionType=open&instanceid=7645&nid=%nid%", new String[]{
"Resource=0",
"RecContentType=text/html",
"Referer=http://192.168.0.120/login/checkLoginAction.action",
"Snapshot=t21.inf",
"Mode=HTML",
LAST});
_webresult = lrapi.web.submit_data("DataAction.do_2",
"Action=http://192.168.0.120/oa/eform/DataAction.do", new String[]{
"Method=POST",
"RecContentType=text/html",
"Referer=http://192.168.0.120/oa/eform/DataAction.do?actionType=query&systemid=gongyongxinxi&subsysid=gongyongxinxi&modid=tztg",
"Snapshot=t22.inf",
"Mode=HTML",
}, new String[]{ // ITEM DATA
"Name=actionType", "Value=goto", ENDITEM,
"Name=doKey", "Value=", ENDITEM,
"Name=eformsysid", "Value=gongyongxinxi", ENDITEM,
"Name=eformsubsysid", "Value=gongyongxinxi", ENDITEM,
"Name=eformmodid", "Value=tztg", ENDITEM,
"Name=eformformid", "Value=tztg", ENDITEM,
"Name=eformflowid", "Value=", ENDITEM,
"Name=eformname", "Value=>> 鍏敤淇℃伅 >> 鍏敤淇℃伅 >> 閫氱煡閫氬憡", ENDITEM,
"Name=eformtype", "Value=B", ENDITEM,
"Name=eformactionid", "Value=", ENDITEM,
"Name=eformpkey", "Value=sno", ENDITEM,
"Name=eformtagid", "Value=", ENDITEM,
"Name=eformismulti", "Value=", ENDITEM,
"Name=eformtarget", "Value=", ENDITEM,
"Name=eformshowtype", "Value=", ENDITEM,
"Name=eformschema", "Value=none", ENDITEM,
"Name=eformqryarea", "Value=", ENDITEM,
"Name=eformsourceurl", "Value=", ENDITEM,
"Name=eformoptions", "Value=title0,faburen1,dept_name2,status3", ENDITEM,
"Name=eformorderby", "Value=", ENDITEM,
"Name=eformselection", "Value=", ENDITEM,
"Name=title0", "Value=", ENDITEM,
"Name=faburen1", "Value=", ENDITEM,
"Name=dept_name2", "Value=", ENDITEM,
"Name=status3", "Value=", ENDITEM,
"Name=dbgrid", "Value=", ENDITEM,
"Name=toPage", "Value=1", ENDITEM,
LAST});
_webresult = lrapi.web.submit_data("AjaxAction.do_2",
"Action=http://192.168.0.120/oa/AjaxAction.do", new String[]{
"Method=POST",
"RecContentType=text/html",
"Referer=http://192.168.0.120/oa/eform/DataAction.do",
"Snapshot=t23.inf",
"Mode=HTML",
}, new String[]{ // ITEM DATA
"Name=actionType", "Value=query", ENDITEM,
"Name=timestamp", "Value=1341912984000", ENDITEM,
"Name=actionType", "Value=query", ENDITEM,
"Name=doKey", "Value=", ENDITEM,
"Name=eformsysid", "Value=gongyongxinxi", ENDITEM,
"Name=eformsubsysid", "Value=gongyongxinxi", ENDITEM,
"Name=eformmodid", "Value=tztg", ENDITEM,
"Name=eformformid", "Value=tztg", ENDITEM,
"Name=eformflowid", "Value=", ENDITEM,
"Name=eformname", "Value=>> 鍏敤淇℃伅 >> 鍏敤淇℃伅 >> 閫氱煡閫氬憡", ENDITEM,
"Name=eformtype", "Value=B", ENDITEM,
"Name=eformactionid", "Value=", ENDITEM,
"Name=eformpkey", "Value=sno", ENDITEM,
"Name=eformtagid", "Value=", ENDITEM,
"Name=eformismulti", "Value=", ENDITEM,
"Name=eformtarget", "Value=", ENDITEM,
"Name=eformshowtype", "Value=", ENDITEM,
"Name=eformschema", "Value=none", ENDITEM,
"Name=eformqryarea", "Value=", ENDITEM,
"Name=eformsourceurl", "Value=", ENDITEM,
"Name=eformoptions", "Value=title0,faburen1,dept_name2,status3", ENDITEM,
"Name=eformorderby", "Value=", ENDITEM,
"Name=eformselection", "Value=", ENDITEM,
"Name=title0", "Value=", ENDITEM,
"Name=faburen1", "Value=", ENDITEM,
"Name=dept_name2", "Value=", ENDITEM,
"Name=status3", "Value=", ENDITEM,
"Name=dbgrid", "Value=", ENDITEM,
"Name=toPage", "Value=1", ENDITEM,
"Name=rndval", "Value=1341912984278", ENDITEM,
LAST});
lr.end_transaction("查看",lr.AUTO);
}catch(Exception e){
e.printStackTrace();
return -1;
}
return 0;
}
}
以上是我的Action中脚本 我想做压力测试 请问哪位朋友可以指点一下啊
我来回答