Selenium Grid Extras не работает тесты - PullRequest
0 голосов
/ 09 октября 2018

Мне было интересно, может ли кто-нибудь помочь мне, в настоящее время я пытаюсь обновить свою сетку селена для запуска дополнительной сетки селена

Это проект https://github.com/groupon/Selenium-Grid-Extras

Я выполняю егов Docker и с помощью Docker Compose сетка работает и работает, но при выполнении тестов с ней я получаю следующее

System.Reflection.TargetInvocationException : Exception has been thrown by the target of an invocation.
  ----> System.InvalidOperationException : Timed out waiting for driver server to start.
Build info: version: '3.8.1', revision: '6e95a6684b', time: '2017-12-01T19:05:32.194Z'
System info: host: '7f6d170d6630', ip: '10.0.0.5', os.name: 'Linux', os.arch: 'amd64', os.version: '4.15.0-34-generic', java.version: '1.8.0_162'
Driver info: driver.version: unknown
TearDown : System.Reflection.TargetInvocationException : Exception has been thrown by the target of an invocation.
  ----> System.InvalidOperationException : Timed out waiting for driver server to start.
Build info: version: '3.8.1', revision: '6e95a6684b', time: '2017-12-01T19:05:32.194Z'
System info: host: '0e31c261cafa', ip: '10.0.0.16', os.name: 'Linux', os.arch: 'amd64', os.version: '4.15.0-34-generic', java.version: '1.8.0_162'
Driver info: driver.version: unknown
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at BoDi.ObjectContainer.CreateObject(Type type, ResolutionList resolutionPath, RegistrationKey keyToResolve)
   at BoDi.ObjectContainer.TypeRegistration.Resolve(ObjectContainer container, RegistrationKey keyToResolve, ResolutionList resolutionPath)
   at BoDi.ObjectContainer.ResolveObject(RegistrationKey keyToResolve, ResolutionList resolutionPath)
   at BoDi.ObjectContainer.Resolve(Type typeToResolve, ResolutionList resolutionPath, String name)
   at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at BoDi.ObjectContainer.CreateObject(Type type, ResolutionList resolutionPath, RegistrationKey keyToResolve)
   at BoDi.ObjectContainer.TypeRegistration.Resolve(ObjectContainer container, RegistrationKey keyToResolve, ResolutionList resolutionPath)
   at BoDi.ObjectContainer.ResolveObject(RegistrationKey keyToResolve, ResolutionList resolutionPath)
   at BoDi.ObjectContainer.Resolve(Type typeToResolve, ResolutionList resolutionPath, String name)
   at lambda_method(Closure , IContextManager )
   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 MoneyUITests.Features.Banking.CreditCards.CreditCardTests1Feature.EnsureTheMoreButtonWorksAndAddsMoreProductsOnCreditCards() in C:\Users\Brian.Mitchell\Documents\Projects\MoneyAutomated\MoneyUITests\Features\Banking\CreditCards\CreditCardTests.feature:line 69
--InvalidOperationException
   at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
   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.Remote.RemoteWebDriver..ctor(Uri remoteAddress, ICapabilities desiredCapabilities)
   at MoneyTestDriver.Utils.SeleniumContext..ctor() in C:\Users\Brian.Mitchell\Documents\Projects\MoneyAutomated\MoneyTestDriver\Utils\SeleniumContext.cs:line 67
--TearDown
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at BoDi.ObjectContainer.CreateObject(Type type, ResolutionList resolutionPath, RegistrationKey keyToResolve)
   at BoDi.ObjectContainer.TypeRegistration.Resolve(ObjectContainer container, RegistrationKey keyToResolve, ResolutionList resolutionPath)
   at BoDi.ObjectContainer.ResolveObject(RegistrationKey keyToResolve, ResolutionList resolutionPath)
   at BoDi.ObjectContainer.Resolve(Type typeToResolve, ResolutionList resolutionPath, String name)
   at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at BoDi.ObjectContainer.CreateObject(Type type, ResolutionList resolutionPath, RegistrationKey keyToResolve)
   at BoDi.ObjectContainer.TypeRegistration.Resolve(ObjectContainer container, RegistrationKey keyToResolve, ResolutionList resolutionPath)
   at BoDi.ObjectContainer.ResolveObject(RegistrationKey keyToResolve, ResolutionList resolutionPath)
   at BoDi.ObjectContainer.Resolve(Type typeToResolve, ResolutionList resolutionPath, String name)
   at lambda_method(Closure , IContextManager )
   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.OnScenarioEnd()
--InvalidOperationException
   at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
   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.Remote.RemoteWebDriver..ctor(Uri remoteAddress, ICapabilities desiredCapabilities)
   at MoneyTestDriver.Utils.SeleniumContext..ctor() in C:\Users\Brian.Mitchell\Documents\Projects\MoneyAutomated\MoneyTestDriver\Utils\SeleniumContext.cs:line 67

У меня есть другая типичная сетка, которая выполняет тесты, так что это не проблема стесты или рамки из того, что я вижу.

Кто-нибудь настраивал это раньше и сталкивался с этой проблемой, я не уверен, как отладить эту проблему.

Вот файл составления докера, который я использую

version: '3'
services:
  seleniumChrome:
    image: minium/selenium-grid-extras-chrome:2.0.4
    restart: unless-stopped
    shm_size: 2g
    ports:
      - "5555:5555"
      - "3100:3000"
    depends_on:
      - seleniumHub
    environment:
      - JAVA_OPTS=-Xms512m -Xmx512m
      - DBUS_SESSION_BUS_ADDRESS=/dev/null
    volumes:
       - /dev/shm:/dev/shm
#       - ./custom_grid_config.json:/opt/selenium/selenium_grid_extras_config.json
#       - ./custom_node_config.json:/opt/selenium/node_5555.json
  seleniumHub:
    image: minium/selenium-grid-extras-hub:2.0.4
    restart: unless-stopped
    ports:
      - "4444:4444"
      - "3000:3000"
    environment:
      - JAVA_OPTS=-Xms512m -Xmx512m
      - SE_OPTS=-debug true
#    volumes:
#       - ./custom_grid_config.json:/opt/selenium/selenium_grid_extras_config.json
#       - ./custom_hub_config.json:/opt/selenium/hub_4444.json
#       - ./log4j.properties:/opt/selenium/log4j.properties
...