2017-10-14 113 views
0

我是量角器工具的新手。我無法在多個瀏覽器中運行我的測試腳本,只能在Chrome中運行。無法在「角度4應用程序」中運行「Firefox瀏覽器中的量角器測試腳本」

我使用

  1. 節點:v6.11.3
  2. NPM:3.10.10
  3. 量角器:5.1.2

我需要使用Visual自動化的角度4應用程序工作室代碼IDE。我添加了「多功能」選項我的Protractor.conf.js如下。

multiCapabilities:[{ 
    'browserName' : 'chrome'}, 
    {'browserName':'firefox'}] 

測試腳本是在只有chrome瀏覽器上運行,對於Firefox則顯示以下錯誤

[11:47:37] I/launcher - 0 instance(s) of WebDriver still running 
[11:47:37] I/launcher - firefox #01 failed with exit code: 135 
[11:47:37] I/launcher - chrome #11 passed 
[11:47:37] I/launcher - overall: 1 process(es) failed to complete 
[11:47:37] E/launcher - Process exited with error code 100 

設置和運行測試腳本平行如何在多個瀏覽器?

回答

0

對於Firefox V48及以上的,你還需要添加木偶能力:

multiCapabilities:[ 
    {'browserName' : 'chrome'}, 
    {'browserName':'firefox', 
    'marionette': true}] 

UPDATE: 有一個在量角器5.1.1推出了open issue #4253。解決方法是用seleniumAddress手動更換directConnect並且如在錯誤指定的手動啓動webdriver-manager

的解決方案是用Firefox測試時使用硒獨立。 最新版本的硒獨立服務器兼容 與Protractor的硒JS綁定和geckodriver。您可以 更新,並與

webdriver-manager update 
webdriver-manager start 

啓動獨立服務器,並設置seleniumAddress: http://localhost:4444/wd/hub

+0

感謝您的答覆。 我試過'marionette'選項它不適合我,仍然顯示同樣的錯誤 – vasundhara

+0

對不起。量角器5.1.1中引入了錯誤,我誤以爲是錯誤的。我已經使用解決方法編輯了我的答案。 – HaC

+0

我跟着上述更新,現在它顯示「無法解析新的會話響應」錯誤消息。進程退出,錯誤代碼爲199。 我安裝了gecko驅動程序,並將其添加到System - PATH變量中。 – vasundhara

0

我可以想到你的錯誤的幾個原因。這裏有一些建議:

默認情況下量角器只會更新Chrome驅動程序。所以請嘗試webdriver-manager updateas described here

如果這沒有辦法,檢查你的firefox驅動程序是否在其預期的位置。 Read more about here

如果你還沒有運氣,你可能會遇到目前的Firefox驅動程序和最新的Firefox瀏覽器(即如果你beta測試新的Firefox瀏覽器版本)之間的不兼容。 Read about the same issue for Chrome here。當然,它將以相同的方式用於Firefox。

相關問題