Docker+Selenium Grid构建分布式Web测试环境(3)

发表于:2017-03-16来源:简书作者:wywincl点击数: 标签:Dockerselenium
/opt/bin/entry_point 24 minutes ago Up 24 minutes 0.0 .0 .0 : 5901 - 5900 /tcp elegant_dijkstrada8c2598666f selenium/hub /opt/bin/entry_point 9 days ago Up 51 minutes 0.0 .0 .0 : 32768 - 4444 /tcp sel
"/opt/bin/entry_point" 24 minutes ago Up 24 minutes 0.0.0.0:5901->5900/tcp elegant_dijkstra da8c2598666f selenium/hub "/opt/bin/entry_point" 9 days ago Up 51 minutes 0.0.0.0:32768->4444/tcp selenium-hub

运行一个基本的测试用例demo.robot,如下所示, 我们的用例是用Robot Framework编写的,具体编写方法请参考Robot Framework测试框架

*** Setting ***
Library    Selenium2Library

*** Variables ***
${HOST}    https://www.baidu.com

*** Test Cases ***
T_Case_1
    Log    Open Browser
    Open Browser    ${HOST}    firefox    remote_url=http://0.0.0.0:32768/wd/hub
    Input Text    id=kw    Robot Framework
    Click Button    id=su
    Capture Page Screenshot
    Sleep    5s
    Close Browser

*** Keywords ***

执行测试用例

原文转自:http://www.jianshu.com/p/52e711918d0c