2013-04-04 70 views
1

我已經在windows 7機器上安裝了jenkins主節點和testLink,名爲machineA。 我已經安裝了,紅寶石1.8.7,1.7.1的Watir,ci_reporter 1.8.4,測試單元2.5.4,耙10.0.3,通過Windows Server 2003上的Java Web開始(JNLP)詹金斯從節點,稱到machineB。這個項目的目標是從machineA開始構建,之後,jenkins slave將在machineB上執行ruby測試(watir,所以用ie導航器),並在machineA上發送報告(由testLink讀取)。詹金斯主節點(等machineA的)上如何在jenkins slave上用watir運行ruby測試?

我的工作配置:

restrict where this project can be run --> machineB 

svn --> url --> svn://serverSVN/project/trunk 

build --> invoke testlink --> testLink cfg --> TestLink Version --> testlink 1.9.3 
               Test Project Name --> my project  
               Test Plan Name --> my testPlan 
               Build Name --> watirTest-$BUILD_NUMBER  
               Custom Fields --> watir 

testExecution --> Single Build Steps --> execute windows batch cmd --> rake test CI_REPORTS=results 

results seeking strategy --> include pattern --> results/*.xml 
          key custom field --> watir 

post-action-build --> publish junit reports --> results/*.xml 

下面的測試,我將在2級型動物的方式執行(以當地上到machineB,並與詹金斯從machineA的)。

require 'rubygems' 
require 'watir' 
require 'test/unit' 
require 'ci/reporter/rake/test_unit_loader' 
include Watir 

class ModifierLocalisation < Test::Unit::TestCase 

    def test_me 
    ie = Watir::IE.new 
    ie.goto("http://ipMachine/shopA/") 
    assert(ie.text.include?("Identification")) 
    end 

end  

當我執行對本地到machineB測試通過了測試,所以這裏的控制檯輸出:

** Invoke test (first_time) 
** Execute test 
E:/Ruby/bin/ruby.exe test/modifierLocalisation.rb 
Loaded suite test/modifierLocalisation 
Started 
. 
Finished in 2.140625 seconds. 

1 tests, 1 assertions, 1 failures, 0 errors 

但是,當我執行測試與machineA的,測試失敗,系統詹金斯(但爲什麼試驗是失敗

** Invoke test (first_time) 
** Execute test 
E:/Ruby/bin/ruby.exe test/modifierLocalisation.rb 
Loaded suite test/modifierLocalisation 
Started 
F 
Finished in 2.140625 seconds. 

1) Failure: 
test_me(ModifierLocalisation) [test/modifierLocalisation.rb:14]: 
<false> is not true. 

1 tests, 1 assertions, 1 failures, 0 errors 
rake aborted! 

我想,當我從machineA的詹金斯執行測試,Internet Explorer不能啓動,這就是:報告發送給TESTLINK machineA上的),所以這裏的控制檯輸出URE。

什麼我可以做任何想法?

回答

1

你可以從遠程機器A.

在你的代碼修改地運行Selenium測試

ie = Watir::IE.new 

capabilities = WebDriver::Remote::Capabilities.htmlunit(:javascript_enabled => true) 
ie = Watir::Browser.new(:remote, :url => 'http://machineB:4444/wd/hub', :desired_capabilities => capabilities) 
ie = Watir::Browser.new :ie 
+0

謝謝,我會在下週測試解決方案:) – JeanLouisGangplank 2013-04-05 08:59:20

+0

我剛剛發現錯誤發生在哪裏! 這個該死的即proc在machineA的任務管理器中保持活動狀態,並且阻止了我的測試的遠程啓動。謝謝你的回答Amey! – JeanLouisGangplank 2013-04-08 07:46:05

相關問題