nitche
nitche

Reputation: 121

Mink with Selenium2 : how to connect to selenium server?

i'm trying to configure Behat tests with selenium server.

my behat.yml is:

default:
  paths:
    features: features
    bootstrap: %behat.paths.features%/bootstrap
extensions:
  Behat\MinkExtension\Extension:
    base_url:  'http://prog.easyhospi.itg.crmsante.com/'
    default_session: 'selenium2'
    browser_name: 'firefox'
    selenium2:        
      wd_host: 'http://127.0.0.1:5555/wd/hub'             
      capabilities: { "browser": "firefox", "version": "29"}

i ran selenium server this way:

java -jar selenium-server-standalone-2.41.0.jar -role hub

and then:

java -jar selenium-server-standalone-2.25.0.jar -role node -hub http://localhost:4444/grid/register -browser browserName=firefox,version=29,maxInstances=1    

I have got the error message "Could not open connection" What is missing?

Upvotes: 1

Views: 2363

Answers (2)

nitche
nitche

Reputation: 121

Ok, sorry for that post, but Curl was missing... didn't see that requirement in the doc.

you are right, selenium grid is not needed, but my behat.yml matches: if i don't specify "default_session: 'selenium2'", i have an error about goutte.

thanks.

Upvotes: 0

Jakub Zalas
Jakub Zalas

Reputation: 36241

Capabilities of at least one node need to match capabilities requested from behat. Last time I used selenium grid, I needed to set the version to an empty string, otherwise selenium could not match the browser version:

# behat.yml
default:
  extensions:
    Behat\MinkExtension\Extension:
      selenium2:
        capabilities:
          version: ''

Note that you don't need to run grid. In most cases it's sufficient to run selenium as a standalone server (this way no capabilities need to be configured):

java -jar selenium-server-standalone-2.25.0.jar

Upvotes: 1

Related Questions