您的位置:軟件測試 > 開源軟件測試 > 開源功能測試工具 > Selenium
Selenium Grid 集成 Hudson(1)
作者:網(wǎng)絡(luò)轉(zhuǎn)載 發(fā)布時間:[ 2014/1/3 13:40:51 ] 推薦標(biāo)簽:selenium Hudson

 selenium Grid

  為什么要用selenium grid呢?當(dāng)我們的用例到達(dá)一定數(shù)量的時候,跑起來很慢,我們想讓用例在一定的時間內(nèi)跑完;蛘哂袝r候我們想讓我們的用例在不同的瀏覽器中同時運(yùn)行。這是我可以考慮selenium Grid了。
    selenium Grid 的原理不贅述了?梢圆榭垂倬W(wǎng):http://selenium-grid.seleniumhq.org/how_it_works.html
   怎么用selenium Grid?
   (1)準(zhǔn)備工作:
      <1.1>配置java環(huán)境變量。
      <1.2>配置ANT的環(huán)境變量。
          新建ant——home 系統(tǒng)變量ant_home.然后在編輯環(huán)境變量path將ant的bin目錄添加進(jìn)去“;%ant_home%in;”
  
      <1.3>下載selenium Grid。網(wǎng)址:http://selenium-grid.seleniumhq.org/download.html 將下載下來的文件夾放在你想放的位置。
    
   (2) 啟動Selenium-hub,在cmd中將目錄轉(zhuǎn)向selenium grid的根目錄。輸入以下目錄 ant launch-hub。ok后可以到:http://localhost:4444/console,看到selnium grid 的當(dāng)前狀態(tài)
   (3)注冊rc,命令是這樣的:
   
ant -Denvironment="*FireFox"  -Dport=5555 -Dhost=192.168.1.182 -DhubURL=http://localhost:4444 launch-remote-control

 

-Denvironment是程序運(yùn)行的瀏覽器。 -Dport是rc在本地的端口號。一個pc不能有兩個端口號相同的rc。然后Dhost是你的rc的的IP. -DHUBURL是我們剛才launch rc那臺機(jī)子hub的url


OK后,可以看到rc的狀態(tài),也是在http://localhost:4444/console看。


(4)如何注銷已注冊的rc? 在網(wǎng)頁輸入以下link(host,port,environment是是要和你要注銷的RC對應(yīng))。
 http://localhost:4444/registration-manager/unregister?host=localhost&port=5555&environment=*firefox,會把剛才注冊的rc取消掉。

(5)前四步,slenium grid的環(huán)境搞好了

軟件測試工具 | 聯(lián)系我們 | 投訴建議 | 誠聘英才 | 申請使用列表 | 網(wǎng)站地圖
滬ICP備07036474 2003-2017 版權(quán)所有 上海澤眾軟件科技有限公司 Shanghai ZeZhong Software Co.,Ltd