LoadRunner??java user???????
???????????? ???????[ 2015/10/13 14:30:50 ] ?????????????????? ??????????
????poptest?????????loadrunner??γ?????webЭ??????????????????Э?????????????????????????????????????????????Э?飬??????????????javauser??????????????δ???
?????ж?java??????????????????????????javauser??????Э?鱨??????????????
?????????????????
????loadrunner11.0
????jdk1.6.32_x86_32
???????????
????1.???JavaVuserЭ??
????2.????java??????Vuser--RunTime Settings??
????3.????javavuser???
/*
* LoadRunner Java script. (Build: _build_number_)
*
* Script Description: JavaVuser???????
*
* creator:jeffsui
*
* Create Time:2015-09-28
*
*/
import java.io.InputStream;
import java.io.OutputStreamWriter;
import java.net.URL;
import java.net.URLConnection;
import lrapi.lr;
public class Actions
{
public int init() throws Throwable {
return 0;
}//end of init
public int action() throws Throwable {
/***???????????*/
lr.start_transaction("????poptest???");
String serverUrl="http://www.poptest.cn/";//???????url·??
OutputStreamWriter out =null;
try {
URL url =new URL(serverUrl);
URLConnection conn = url.openConnection();.//????????
conn.setDoInput(true);
conn.setDoOutput(true);
conn.setRequestProperty("Content-Type"??"UTF-8");//???????????????
out=new OutputStreamWriter(conn.getOutputStream()??"UTF-8");//?????????????
out.flush();
out.close();
InputStream in =conn.getInputStream();
byte[] buffer= new byte[in.available()];
in.read(buffer);
System.out.println(new String(buffer));
} catch (Exception e ) {
e.printStackTrace();
}finally{
if(out!=null){
try {
out.close();
} catch (Exception e ) {
e.printStackTrace();
}
}
}
lr.end_transaction("????poptest???"?? lr.AUTO);
return 0;
}//end of action
public int end() throws Throwable {
return 0;
}//end of end
}
????4.????
????5.??н??
????poptest????????
????(1)loadrunner11????32λ??jdk
????(2)RuntimeSettings?????????????jdk????????????????????????jar??????JavaFunction?м???
????(3)JavaVuser?????Ч??????????Java????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11