Я запускаю тесты пользовательского интерфейса на собственном агенте Windows 10 в Azure DevOps. Тест начинает работать нормально, но после определенных шагов я начинаю получать ошибку «Chrome недоступен». Я не уверен, почему это происходит. Меня озадачивает то, что, когда я запускаю одни и те же тесты на моем старом Windows 2012 самодостаточном агенте, они работают нормально.
Оба они имеют одинаковую версию Chrome и драйвер chrome объединяется с помощью nuget.
Это журналы, которые я получаю
A total of 1 test files matched the specified pattern.
Starting ChromeDriver 81.0.4044.69 (6813546031a4bc83f717a2ef7cd4ac6ec1199132-refs/branch-heads/4044@{#776}) on port 62049
Only local connections are allowed.
Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.
Starting ChromeDriver 81.0.4044.69 (6813546031a4bc83f717a2ef7cd4ac6ec1199132-refs/branch-heads/4044@{#776}) on port 62156
Only local connections are allowed.
Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.
X DismissAnAlert("North",null) [39s 791ms]
Standard Output Messages:
C:\vstsagent\A4\_work\r5\a\_MyProject Automation UI Tests\AutomationTests
When I select a specific "North" area and click on go to Alerts
-> done: SelectMonitoringAreasSteps.WhenISelectASpecificAreaAndClickOnGoToAlerts("North") (3.8s)
And I click on the first alert to view
-> done: AlertsSteps.WhenIClickOnTheFirstAlertToView() (3.3s)
Then I should see options to convert or dismiss an alert are displayed
-> error: chrome not reachable
(Session info: chrome=81.0.4044.129)
When I select option to "dismiss" an incident
-> skipped because of previous errors
Then I should see warning message as "Are you sure you want to dismiss this alert"
-> skipped because of previous errors
When I click on Dismiss alert button
-> skipped because of previous errors
Then the alert should be dismissed and should be disappeared from map and alert queue
-> skipped because of previous errors
And I should see that dismissed alert has been audited in the audit log table
-> skipped because of previous errors
Error Message:
OpenQA.Selenium.WebDriverException : chrome not reachable
(Session info: chrome=81.0.4044.129)
TearDown : OpenQA.Selenium.WebDriverException : chrome not reachable
(Session info: chrome=81.0.4044.129)
Stack Trace:
at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
at OpenQA.Selenium.Remote.RemoteWebDriver.FindElement(String mechanism, String value)
at OpenQA.Selenium.Remote.RemoteWebDriver.FindElementByCssSelector(String cssSelector)
at OpenQA.Selenium.By.<>c__DisplayClass23_0.<CssSelector>b__0(ISearchContext context)
at OpenQA.Selenium.By.FindElement(ISearchContext context)
at OpenQA.Selenium.Remote.RemoteWebDriver.FindElement(By by)
at MyCompanyMyProject.Automation.Tests.Pages.AlertsPage.get_AlertMonitoringAreaElement() in c:\vstsagent\A3\_work\16\s\MyCompanyMyProject.Automation.Tests\MyCompanyMyProject.Automation.Tests\Pages\AlertsPage.cs:line 28
at MyCompanyMyProject.Automation.Tests.Pages.AlertsPage.GetAlertCardDetails() in c:\vstsagent\A3\_work\16\s\MyCompanyMyProject.Automation.Tests\MyCompanyMyProject.Automation.Tests\Pages\AlertsPage.cs:line 53
at MyCompanyMyProject.Automation.Tests.Steps.AlertsSteps.ThenIShouldSeeOptionsToConvertOrDismissAnAlertAreDisplayed() in c:\vstsagent\A3\_work\16\s\MyCompanyMyProject.Automation.Tests\MyCompanyMyProject.Automation.Tests\Steps\AlertsSteps.cs:line 125
at TechTalk.SpecFlow.Bindings.BindingInvoker.InvokeBinding(IBinding binding, IContextManager contextManager, Object[] arguments, ITestTracer testTracer, TimeSpan& duration)
at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.ExecuteStepMatch(BindingMatch match, Object[] arguments)
at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.ExecuteStep(IContextManager contextManager, StepInstance stepInstance)
at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.OnAfterLastStep()
at TechTalk.SpecFlow.TestRunner.CollectScenarioErrors()
at MyCompanyMyProject.Automation.Tests.TestFeatures.DismissAlertFeature.ScenarioCleanup()
at MyCompanyMyProject.Automation.Tests.TestFeatures.DismissAlertFeature.DismissAnAlert(String monitoring, String[] exampleTags) in c:\vstsagent\A3\_work\16\s\MyCompanyMyProject.Automation.Tests\MyCompanyMyProject.Automation.Tests\TestFeatures\DismissAlert.feature:line 14
--TearDown
at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
at OpenQA.Selenium.Remote.RemoteWebDriver.GetScreenshot()
at MyCompanyMyProject.Automation.Tests.Steps.Initialiser.TakeScreenshot(IWebDriver driver) in c:\vstsagent\A3\_work\16\s\MyCompanyMyProject.Automation.Tests\MyCompanyMyProject.Automation.Tests\Steps\Initialiser.cs:line 131
at MyCompanyMyProject.Automation.Tests.Steps.Initialiser.CloseDriver() in c:\vstsagent\A3\_work\16\s\MyCompanyMyProject.Automation.Tests\MyCompanyMyProject.Automation.Tests\Steps\Initialiser.cs:line 86
at TechTalk.SpecFlow.Bindings.BindingInvoker.InvokeBinding(IBinding binding, IContextManager contextManager, Object[] arguments, ITestTracer testTracer, TimeSpan& duration)
at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.InvokeHook(IBindingInvoker invoker, IHookBinding hookBinding, HookType hookType)
at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.FireEvents(HookType hookType)
at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.FireScenarioEvents(HookType bindingEvent)
at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.OnScenarioEnd()
at TechTalk.SpecFlow.TestRunner.OnScenarioEnd()
at MyCompanyMyProject.Automation.Tests.TestFeatures.DismissAlertFeature.TestTearDown()