0

Added the code for the profile as follows. If remove the idle-timeout it works fine and if added gives the exception- [Symfony\Component\Config\Definition\Exception\InvalidConfigurationException]
Unrecognized options "idle_timeout" under "behat.extensions.behat_minkextension_extension.selenium2.capabilities"

Windows8_IE10: context: class: 'FeatureContext' extensions: Behat\MinkExtension\Extension: selenium2: browser: internet explorer wd_host: seodevelopment:@ondemand.saucelabs.com/wd/hub capabilities: { "platform": "Windows 8", "version": "10", "idle-timeout": 200}

OLDRomeo
  • 33
  • 9

1 Answers1

0

This happens because there is a table of recognised capabilities and idle-timeout is not one of them. It's put in place to filter out bad configuration and notify you if you messed something up. The work around is to use 'extra_capabilities' option, that doesn't get normalised and validated and won't throw this error. Unfortunately the documentation doesn't cover a lot of things like that and you have to learn them yourself (or here).

Windows8_IE10:
  context:
    class:  'FeatureContext'
  extensions:
    Behat\MinkExtension\Extension:
     selenium2:
        browser: internet explorer
        wd_host:  seodevelopment:@ondemand.saucelabs.com/wd/hub
        capabilities: { "platform": "Windows 8", "version": "10" }
        extra_capabilities: { "idle-timeout": 200 }

Extra capabilities are merged with the capabilities object and passed to the Selenium server when Mink starts a new session. The difference between the two is that extra capabilities object doesn't get normalised like the capabilities, so you can specify whatever you want there. When you run the Selenium server it logs when the session is started and what capabilities the browser driver receives.

21:54:51.659 INFO - Executing: [new session: Capabilities [{tags=[Ian-Bytcheks-MacBook-Pro.local, PHP 5.5.15], platform=ANY, browserVersion=9, ignoreZoomSetting=false, browserName=chrome, deviceType=tablet, name=Behat feature suite, browser=chrome, deviceOrientation=portrait, chromeOptions={args=[--test-type]}, version=21}]])

Note, this relates to Behat 3, earlier versions may differ. Find the tag in the Mink Selenium 2 Driver repo and look for the similar class that implements this logic.

Ian Bytchek
  • 8,804
  • 6
  • 46
  • 72
  • I guess doesnt work the way you have suggested. https://github.com/Behat/MinkExtension/blob/master/src/Behat/MinkExtension/ServiceContainer/Driver/SauceLabsFactory.php The class extends Selenium2Factory and has getcapabilities method which call the parent function and get the selenium capabilities object and then adds the saucelabs paramters to it. So I guess the idle-timeout doesn;t fit in extra_capabilities but i should be in the capabilities itself.The parser is parsing "-" as"_" and so it is not able to find the parameter and required configuration.Correct me if I am wrong. – OLDRomeo Aug 18 '14 at 17:13
  • Updated the answer. I've used it successfully to pass Chrome `chromeOptions={args=[--test-type]}` configuration via `extra_capabilities` setting. I just tried adding `"idle-timeout": 200` to the list of my config and it passed everything as expected to Selenium: `new session: Capabilities [{tags=[Ian-Bytcheks-MacBook-Pro.local, PHP 5.5.15], idle-timeout=200, platform=ANY, …`. What Mink / Behat version are you on? Can you post the `new session` entry from the Selenium log? – Ian Bytchek Aug 18 '14 at 18:07
  • This is my Executing: [new session: {browserVersion=9, ignoreZoomSetting=false, browserName=internet explorer, webdriver.remote.quietExceptions=true}] at URL: /session) session entry - – OLDRomeo Aug 18 '14 at 20:14
  • How come it doesn't contain the "idle-timeout" at all in any form? – Ian Bytchek Aug 18 '14 at 20:47
  • I guess my version is low. I have the versions mentioned as '@stable' in composer.json and i guess its not updated since an year. Do you know any way to check the version of mink extension? I am new to this stuff – OLDRomeo Aug 19 '14 at 13:30
  • You can versions of installed dependencies in the `composer.lock`. – Ian Bytchek Aug 19 '14 at 13:43