如何在詹金斯执行机器人测试用例

时间:2019-12-30 22:14:30

标签: selenium jenkins robotframework

我在如何在詹金斯(Jenkins)中执行机器人测试用例上挣扎。我的项目设置如下: 源代码管理:GIT 建立:执行Shell

这就是我在shell中尝试过的方法: python -m robot.run TestCases

但是我得到以下输出错误:

Commit message: "robot framework start"
 > /usr/bin/git rev-list --no-walk 9adbfb88132f5ec3fceb0c9863eab141f93d29f6 # timeout=10
[SampleJob] $ /bin/sh -xe /tmp/jenkins14811373557342144066.sh
+ python -m robot.run TestCases
==============================================================================
TestCases                                                                     
==============================================================================
TestCases.Login TC :: This test is for open login and close browser           
==============================================================================
Register Form                                                         | FAIL |
Setup failed:
WebDriverException: Message: invalid argument: can't kill an exited process


Also teardown failed:
No browser is open.
------------------------------------------------------------------------------
Choose Radio Button                                                   | FAIL |
Setup failed:
WebDriverException: Message: invalid argument: can't kill an exited process


Also teardown failed:
No browser is open.
------------------------------------------------------------------------------
TestCases.Login TC :: This test is for open login and close browser   | FAIL |
2 critical tests, 0 passed, 2 failed
2 tests total, 0 passed, 2 failed
==============================================================================
TestCases.TC002 FetchData :: This test is for open login and close browser    
==============================================================================
Test                                                                  | FAIL |
Setup failed:
WebDriverException: Message: invalid argument: can't kill an exited process

这是TestCases文件夹中的示例测试

*** Settings ***
Library    SeleniumLibrary
Resource    ../Resources/BeforeTest.robot
Documentation    This test is for open login and close browser
Test Setup    Start Browser and Maximize
Test Teardown    Close Browser Window
*** Variables ***
${Browser}
${URL}

*** Test Cases ***
Register Form

    Enter user, mail and pass    thisistheusername    thisistheemail    thisisthepassword

Choose Radio Button
  Select Radio Button    add_type    home   
  Select From List By Index    name:sex    2    

*** Keywords ***
Enter user, mail and pass
    [Arguments]    ${username}    ${email}    ${password}   
    Input Text    name=fld_username    ${username}      
    Input Text    xpath=//input[@type='email']    ${email}
    Input Text    name=fld_password    ${password}

当我从终端执行代码时,一切正常。

0 个答案:

没有答案
相关问题