2016-06-09 3 views
1

Теперь попробуйте запустить тесты Selenium с использованием сервера Teamcity. Сервер устанавливается локально. В настоящий момент проект в teamcity состоит из 3 этапов:Не удается запустить C# + SeleniumWebDriver + Specflow + тесты Nunit на Teamcity

  1. NuGet instaler.
  2. Шаг с Visual Studio в качестве бегуна.
  3. Шаг с NUnit как бегун.

В этот момент 1 и 2 этапы успешно завершены. 3-й этап завершается с следующей записью в журнале:

[Step 3/3] Volvo.DigitalCommerce.AutomatedTests.dll (9m:11s) 
[15:02:26][Volvo.DigitalCommerce.AutomatedTests.dll] Volvo.DigitalCommerce.AutomatedTests.Features.ChildSeat.CS_BaseFlowFeature.CS_GoingThroughFullFlow on Chrome (1m:01s) 
[15:03:28][Step 3/3] Starting ChromeDriver 2.21.371459 (36d3d07f660ff2bc1bf28a75d1cdabed0983e7c4) on port 6915 
[15:03:28][Step 3/3] Only local connections are allowed. 
[15:03:28] 
[Volvo.DigitalCommerce.AutomatedTests.Features.ChildSeat.CS_BaseFlowFeature.CS_GoingThroughFullFlow on Chrome] [Test Error Output] 
-> warning: The previous ScenarioContext was already disposed. 
[15:03:28] 
[Volvo.DigitalCommerce.AutomatedTests.Features.ChildSeat.CS_BaseFlowFeature.CS_GoingThroughFullFlow on Chrome] TearDown method failed. Autofac.Core.DependencyResolutionException : An exception was thrown while invoking the constructor 'Void .ctor()' on type 'ChromeDriver'. ---> The HTTP request to the remote WebDriver server for URL http://localhost:6896/session timed out after 60 seconds. (See inner exception for details.) 
    ----> OpenQA.Selenium.WebDriverException : The HTTP request to the remote WebDriver server for URL http://localhost:6896/session timed out after 60 seconds. 
    ----> System.Net.WebException : The request was aborted: The operation has timed out. 
TearDown : System.NullReferenceException : Object reference not set to an instance of an object. 
[15:03:28] 
[Volvo.DigitalCommerce.AutomatedTests.Features.ChildSeat.CS_BaseFlowFeature.CS_GoingThroughFullFlow on Chrome] TearDown method failed. Autofac.Core.DependencyResolutionException : An exception was thrown while invoking the constructor 'Void .ctor()' on type 'ChromeDriver'. ---> The HTTP request to the remote WebDriver server for URL http://localhost:6896/session timed out after 60 seconds. (See inner exception for details.) 
    ----> OpenQA.Selenium.WebDriverException : The HTTP request to the remote WebDriver server for URL http://localhost:6896/session timed out after 60 seconds. 
    ----> System.Net.WebException : The request was aborted: The operation has timed out. 
TearDown : System.NullReferenceException : Object reference not set to an instance of an object. 
    at Autofac.Core.Activators.Reflection.ConstructorParameterBinding.Instantiate() 
    at Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters) 
    at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters) 
    at Autofac.Core.Resolving.InstanceLookup.Execute() 
    at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable`1 parameters) 
    at Autofac.Core.Resolving.ResolveOperation.Execute(IComponentRegistration registration, IEnumerable`1 parameters) 
    at Autofac.Core.Lifetime.LifetimeScope.ResolveComponent(IComponentRegistration registration, IEnumerable`1 parameters) 
    at Autofac.Core.Container.ResolveComponent(IComponentRegistration registration, IEnumerable`1 parameters) 
    at Autofac.ResolutionExtensions.TryResolveService(IComponentContext context, Service service, IEnumerable`1 parameters, Object& instance) 
    at Autofac.ResolutionExtensions.ResolveService(IComponentContext context, Service service, IEnumerable`1 parameters) 
    at Autofac.ResolutionExtensions.ResolveNamed[TService](IComponentContext context, String serviceName, IEnumerable`1 parameters) 
    at Volvo.DigitalCommerce.AutomatedTests.Features.ChildSeat.CS_BaseFlowFeature.CS_GoingThroughFullFlow(String browser) in C:\TeamCity\buildAgent\work\d7512e1031e4b296\Volvo.DigitalCommerce.AutomatedTests\Features\Child Seat\CS_BaseFlow.feature.cs:line 0 
--WebDriverException 
    at OpenQA.Selenium.Remote.HttpCommandExecutor.CreateResponse(WebRequest request) 
    at OpenQA.Selenium.Remote.HttpCommandExecutor.Execute(Command commandToExecute) 
    at OpenQA.Selenium.Remote.DriverServiceCommandExecutor.Execute(Command commandToExecute) 
    at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters) 
    at OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities desiredCapabilities) 
    at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities) 
    at OpenQA.Selenium.Chrome.ChromeDriver..ctor(ChromeOptions options) 
    at lambda_method(Closure , Object[]) 
    at Autofac.Core.Activators.Reflection.ConstructorParameterBinding.Instantiate() 
--WebException 
    at System.Net.HttpWebRequest.GetResponse() 
    at OpenQA.Selenium.Remote.HttpCommandExecutor.CreateResponse(WebRequest request) 
--TearDown 
    at Volvo.DigitalCommerce.AutomatedTests.Features.ChildSeat.CS_BaseFlowFeature.ScenarioTearDown() in C:\TeamCity\buildAgent\work\d7512e1031e4b296\Volvo.DigitalCommerce.AutomatedTests\Features\Child Seat\CS_BaseFlow.feature.cs:line 0 
[15:03:28][Volvo.DigitalCommerce.AutomatedTests.dll] Volvo.DigitalCommerce.AutomatedTests.Features.DigitalCommerce.FullFlowTestFeature.DC_FullFlow on Chrome (1m:01s) 

Может кто-нибудь помочь с этой ошибкой? Заранее спасибо, Валентин.

ответ

1

Наша автоматическая тестовая версия не срабатывала по той же причине, и вчера, после нескольких попыток решения нескольких часов, наша команда проследила эту проблему с тем, что Teamcity Build Agent Service: выполнялся под учетной записью системы. Обычно это не должно быть проблемой, но в нашем случае Chrome не запускался/открывался при запуске под учетной записью локальной системы.

Это оказалось проблемой, когда мы вручную запускали NUnit на нашем CI-сервере и не испытывали проблемы.

После обновления службы использовать new user account (пароль никогда не истекает, не может войти)

И добавил новый пользователь в настройках безопасности для каждого из папок, что наши ссылки сборки (если не сделать его администратором) , Chromedriver смог инициализировать правильно, и пакет работает нормально.

Мы по-прежнему не знаем корневой проблемы, почему Chrome не инициализировался во время работы под локальной системной учетной записью, но мы предполагаем, что это связано с тем, что Chrome требует наличия какой-либо папки или файлов, которые имеют только учетные записи пользователей (Desktop, App_Data и т. Д.)

+0

В качестве обновления вы можете отслеживать эту ошибку [здесь] (https://bugs.chromium.org/p/chromium/issues/detail?id=615396) –

Смежные вопросы