我有一套Selenium测试,可以在本地环境中完美地工作,并使用Browserstack automatic,但在azuredevops上失败。
在Azure Devops上运行时没有配置或设置更改。
我们遵循了这里的所有文档:
https://docs.microsoft.com/en-us/azure/devops/pipelines/test/continuous-test-selenium?view=vsts
随机测试失败,从来不是相同的测试。
测试总是因为超时而失败。我等待页面加载5分钟,这样就不会出现超时过低的情况。
没有防火墙,应用程序是公共的。
身份验证总是成功的,因此测试能够加载应用程序。
下面是Azure DevOps日志的副本。4项测试通过了,但其他的都失败了。通常,只有4-5个测试失败。
这个测试使用BrowserStack automatic(远程selenium)和本地测试非常有效。
2018-11-17T05:40:28.6300135Z Failed StripeAdmin_WhenOnTab_DefaultSortIsByIdDescending
2018-11-17T05:40:28.6300461Z Error Message:
2018-11-17T05:40:28.6304198Z Test method CS.Portal.E2e.Tests.Admin.StripeAdmin.StripeAdminTests.StripeAdmin_WhenOnTab_DefaultSortIsByIdDescending threw exception:
2018-11-17T05:40:28.6305677Z OpenQA.Selenium.WebDriverTimeoutException: Timed out after 300 seconds
2018-11-17T05:40:28.6307041Z Stack Trace:
2018-11-17T05:40:28.6307166Z at OpenQA.Selenium.Support.UI.DefaultWait`1.ThrowTimeoutException(String exceptionMessage, Exception lastException)
2018-11-17T05:40:28.6307999Z at OpenQA.Selenium.Support.UI.DefaultWait`1.Until[TResult](Func`2 condition)
2018-11-17T05:40:28.6308188Z at CS.Portal.E2e.Tests.Utility.WebDriverUtilities.WaitForElement(IWebDriver driver, By by, Boolean mustBeDisplayed) in D:\a\1\s\CS.Portal.E2e.Tests\Utility\WebDriverUtilities.cs:line 26
2018-11-17T05:40:28.6319651Z at CS.Portal.E2e.Tests.Admin.StripeAdmin.StripeAdminTests.StripeAdmin_WhenOnTab_DefaultSortIsByIdDescending() in D:\a\1\s\CS.Portal.E2e.Tests\Admin\StripeAdmin\StripeAdminTests.cs:line 51
2018-11-17T05:40:28.6319982Z
2018-11-17T05:40:34.4671568Z Results File: D:\a\1\s\TestResults\VssAdministrator_factoryvm-az416_2018-11-17_03_08_24.trx
2018-11-17T05:40:34.4692222Z
2018-11-17T05:40:34.4695222Z Attachments:
2018-11-17T05:40:34.4697610Z D:\a\1\s\TestResults\672f4d28-5082-42e9-a7e7-f5645aadcfd8\VssAdministrator_factoryvm-az416 2018-11-17 03_02_43.coverage
2018-11-17T05:40:34.4697943Z
2018-11-17T05:40:34.4698278Z Total tests: 34. Passed: 4. Failed: 30. Skipped: 0.