【问题标题】:Selenium Webdriver scripts failed to run thru jenkins when using an AutoIT.exe使用 AutoIT.exe 时,Selenium Webdriver 脚本无法通过 jenkins 运行
【发布时间】:2017-01-19 17:07:42
【问题描述】:

我有一个使用 Selenium webdriver 关键字构建的脚本。此脚本具有用于文件上传的特定任务的 autoIt.ext。它与 Eclipse 一起工作正常。但是,当我使用 Jenkins 安排它们时,它在这一步失败了。

ControlFocus("Open", "", "Edit1")

ControlSetText("打开", "", "Edit1", "C:\XXX\xxx.jpg") ControlClick("打开", "", "Button1")

    - The keyword:

public static void file_Upload(String vKeyword){

        new WebDriverWait(myDriver, 30).until(ExpectedConditions.elementToBeClickable(By.xpath("//input[@title='Choose a file to upload']")));
        myDriver.findElement(By.xpath("//input[@title='Choose a file to upload']")).click();
 Runtime.getRuntime().exec("C:\XXX\xxx.exe");
        }  

【问题讨论】:

    标签: jenkins autoit


    【解决方案1】:

    我也遇到了同样的问题,但通过将 .exe 文件直接上传到 git repo 解决了这个问题。 试试这个,可能是你的运气!

    【讨论】:

    • 这是我修复它的方法。对于这个不太合乎逻辑的问题,我在 AutoIT 代码中添加了“Sleep(2000)”,瞧,它起作用了。 ControlFocus("Open","","Edit1") ControlSetText("Open","","Edit1","Drive:\Location\file.extn") Sleep(2000) ControlClick("Open","", "按钮1")
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-09-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多