Search code examples
seleniumnetbeansxdebugbehat

Start Xdebug while performing test with behat and selenium


I configured Behat to work with Selenium Standalone 3.0.1 and Chrome driver, but now, I need to add breakpoints in my code to debug it, so i need to enable Xdebug.

When my Chrome browser is launched my selenium, I need to add XDEBUG_SESSION_START=1 to the url.

How can i do that?


Solution

  • Finally found the answer by myself. You need to add xdebug parameter in senario url :

    Feature:check account
    
    Scenario: local login
      Given I am on "/login?XDEBUG_SESSION_START=netbeans-xdebug"
      When I fill in "_username" with "testuser"
      And I fill in "_password" with "testuser"
      And I press "Envoyer"
      Then I should be on "/"
      And I should see "Main"
    

    In addition, I created a batch file to trigger behat with xdebug

    SET XDEBUG_CONFIG="idekey=netbeans-xdebug"
    cd C:\netbeanprojetject\myproject
    bin\behat.bat