使用behat和selenium执行测试时启动Xdebug

时间:2016-11-14 15:28:50

标签: selenium netbeans xdebug behat

我将Behat配置为使用Selenium Standalone 3.0.1和Chrome驱动程序,但是现在,我需要在我的代码中添加断点来调试它,所以我需要启用Xdebug。

当我的Chrome浏览器启动我的selenium时,我需要将XDEBUG_SESSION_START = 1添加到网址。

我该怎么做?

1 个答案:

答案 0 :(得分:0)

终于找到了自己的答案。您需要在senario url中添加xdebug参数:

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"

此外,我创建了一个批处理文件来触发使用xdebug

的behat
SET XDEBUG_CONFIG="idekey=netbeans-xdebug"
cd C:\netbeanprojetject\myproject
bin\behat.bat
相关问题