autoit 处理文件上传弹出框,并在JAVA中调用

Java  代码

//定义exe 文件存放的绝对路径

 File file2 = new File(".");
String command = file2.getCanonicalPath()+"\\resources\\pages\\testdata\\"+"UploadFile.exe"; //Java中调用autoit.exe程序
Runtime run = Runtime.getRuntime();
try{
Process pro=run.exec(command);
BufferedInputStream in=new BufferedInputStream(pro.getInputStream());
BufferedReader br=new BufferedReader(new InputStreamReader(in));
String s;
while((s=br.readLine())!=null){
System.out.println(s);
} }
catch(IOException e){
System.out.println(e);
}

=========================================================

Autoit.exe代码:实现功能:将文件的路径粘贴

WinActivate("Choose file to upload") ControlFocus("Choose file to upload", "", "")

Dim $nr 

$nr=ClipGet() 

Send($nr)

 Send("{Enter}")
上一篇:使用SonarQube进行分析导致0个文件被索引且没有报告(Maven项目)


下一篇:python正则表达式模块re