问题
Previously I worked with Behat 3 and Stand Alone Server 2.45 and everything worked properly.
I use PhpStorm as my IDE. Later, after installing the update of Firefox (ver. 48.0) my tests stop working. I also try to run tests with Selenium Standalone Server ver. 3.0.0-beta3 but Firefox browser not open.
Is there any way to run tests under browser FF 48.0? Maybe someone would like to share information about the working configuration of Behat, FF48 and Stand Alone Server?
回答1:
Starting the selenium server standalone with chrome driver command,
for latest selenium (3.0+)
java -Dwebdriver.chrome.driver=chromedriver.exe -jar selenium-server-standalone-3.0.0-beta2.jar
for older versions (lower than 3)
java -jar selenium-server-standalone-2.53.1.jar -Dwebdriver.chrome.driver=chromedriver.exe
So for the latest selenium you need to specify the driver first and after that, the selenium jar.
Note: use the appropriate chromedriver version for your os
回答2:
Maybe we need some more information about your behat.yml and the information that the selenium logs are giving to you.
Only for reference, here you have my config for running firefox under Behat 3 an Selenium3-beta3.
extensions:
Behat\MinkExtension:
base_url: "http://www.your-web.dev/"
sessions:
firefox_mac:
selenium2:
browser: "firefox"
wd_host: http://xxx.xxx.xxx.xxx:4444/wd/hub
capabilities: { "platform": "MAC", "browser": "firefox", "version": "" }
You should link your PHPStorm to the behat executable and the configuration file to the firefox behat.yml. If you have your interpreter in PhpStorm well configured, it should work.
Does Phpstorm shows you some error?
回答3:
Behat is not compatible at the moment with selenium3 use selenium 2.53 instead.
来源:https://stackoverflow.com/questions/39468600/how-to-run-tests-in-behat-on-firefox-48-0-using-selenium-stand-alone-server