2016-07-28 94 views
0

我收到了此堆棧跟蹤。無法發現打開的頁面。無法在Chrome瀏覽器中從jenkins運行我的測試套件

Default Logging level is set to ERROR 
Loping for strBrowserType chrome 
Starting ChromeDriver (v2.9.248315) on port 42027 
Tests run: 32, Failures: 1, Errors: 0, Skipped: 31, Time elapsed: 67.337 sec <<< FAILURE! - in TestSuite 
setupSuite(com.ambab.carworkz.testcases.ServiceEstimatorTestTc) Time elapsed: 66.668 sec <<< FAILURE! 
org.openqa.selenium.WebDriverException: 
unknown error: unable to discover open pages 
    (Driver info: chromedriver=2.9.248315,platform=Windows NT 6.1 SP1 x86_64) (WARNING: The server did not provide any stacktrace information) 
Command duration or timeout: 61.06 seconds 
Build info: version: '2.53.0', revision: '35ae25b1534ae328c771e0856c93e187490ca824', time: '2016-03-15 10:43:46' 
System info: host: 'ROBER-QA', ip: '192.168.0.70', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_91' 
Driver info: org.openqa.selenium.chrome.ChromeDriver 

結果:

Failed tests: 
    ServiceEstimatorTestTc>Base.setupSuite:114 » WebDriver unknown error: unable t... 

Tests run: 32, Failures: 1, Errors: 0, Skipped: 31 

[ERROR] There are test failures. 

,我從在Chrome瀏覽器詹金斯這是當我面對這個問題的時候測試套件。如果我直接從eclipse IDE運行套件,那麼它運行良好。當我在Firefox中運行相同的測試套件時,它也運行良好。

我已經安裝了最新版本的chrome和chrome驅動程序。與maven運行jenkins工作。

嘗試使用無沙箱以及鉻瀏覽器設置自動檢測設置的變化。詹金斯也是我在主人身上運行的工作,沒有奴隸。嘗試了每個可能的解決方案。如果有更多的解決方案,請讓我知道。

+0

除非我失去了一些東西,ChromeDriver的最新版本應該是2.22,按照:https://開頭sites.google.com/a/chromium.org/chromedriver/downloads – Josh

+0

@Josh我也使用了2.22以及..似乎沒有任何工作。我在過去的2天裏一直堅持這個!需要儘快解決這個問題!它吸吮太多時間.. –

+0

只是爲了排除這種遠程可能性,詹金斯也運行在Windows機器上,對吧? – Morfic

回答

0

我已經添加了這個東西,它解決了我的情況。也有可能是與運行詹金斯用戶的問題(應該設置爲管理員)

ChromeOptions options = new ChromeOptions(); options.AddUserProfilePreference("download.default_directory", DownloadsPath); options.SetLoggingPreference(LogType.Browser, LogLevel.Severe); options.AddArguments("ignore-certificate-errors"); options.AddArguments("--allow-running-insecure-content"); options.AddArguments("test-type"); options.AddArguments("start-maximized"); options.AddArguments("--disable-extensions"); options.AddArguments("no-sandbox"); var ChromeService = ChromeDriverService.CreateDefaultService(); ChromeService.HideCommandPromptWindow = true; instance = new ChromeDriver(ChromeService, options, TimeSpan.FromSeconds(200));

相關問題