|
如果你录制的脚本,是JAVA的话,则可以直接写JAVA代码的。
我的一个简单例子,供参考:
import lrapi.lr;
import java.lang.*;
//import java.net.*;
import test.package.Client;
public class Actions
{
private String user_name,user_pwd;
public int init() {
user_name = "<username>";
//user_name = "user1";
user_pwd = "123";
lr.output_message(user_name);
return 0;
}//end of init
public int action() {
//java.lang.String[] a={"<operate_name>"};
java.lang.String[] a={"publishDocument"};
// lr.output_message(a[0]);
Client client = new Client();
//DocumentRequester_URI
client.name= "testddddd";
lr.start_transaction("PublichdocumentTrans");
client.execute(a);
lr.end_transaction("PublichdocumentTrans", lr.AUTO);
return 0;
}//end of action
public int end() {
return 0;
}//end of end |
|