????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????