close

# 啟動 Xvfb, 有啟動 x window 可忽略此步驟
centos:~ # Xvfb :99 -ac -screen 0 1280x960x16 &
centos:~ # export DISPLAY=:99

# 啟動 selenium rc
centos:~ # wget -O selenium-server-standalone-3.4.0.jar https://goo.gl/s4o9Vx
centos:~ # java -jar selenium-server-standalone-3.4.0.jar -port 4444 1> output.log 2> error.log &
centos:~ # echo $! > selenium.pid
centos:~ # curl http://localhost:4444/grid/console
centos:~ # cat test.robot
*** Settings ***
Library        Selenium2Library

*** Variables ***
${delay}=  ${1}
${google_url}=  http://www.google.com
${browser}=  firefox
${remote_url}=  http://127.0.0.1:4444/wd/hub

*** Test Cases ***
Test Google
    Open Browser  ${google_url}  ${browser}  remote_url=${remote_url}
    Capture Page Screenshot
    Close Browser

centos:~ # pybot test.robot
 

arrow
arrow
    文章標籤
    RobotFramework
    全站熱搜

    wsunccake 發表在 痞客邦 留言(0) 人氣()