您的位置:首页 > 其它

[selenium2]利用AUTOIT上传 下载

2015-10-20 16:54 447 查看
If $CmdLine[0]<1 Then Exit EndIf

handleUpload($CmdLine[1])

 

Func handleUpload($uploadfile)

 Dim $title="文件上传"

If WinWait($title,"",4) Then

    WinActivate($title)

    Sleep (1000)

    ControlSetText($title,"","Edit1",$uploadfile)  

    ControlClick($title,"","Button1")

Else

    Return False

EndIf
EndFunc
https://www.autoitscript.com/site/autoit/
java

    public void handleUpload(String execute_file,String filepath) {

        

        String cmd = "\"" + execute_file + "\"" + " " + "\"" + filepath + "\""; //with arguments

        

        try {

            Process p = Runtime.getRuntime().exec(cmd);

            p.waitFor(); //wait for the upload.exe to complete

        } catch (Exception e) {

            e.printStackTrace();

        }

    }
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: