因此,我使用無頭瀏覽器正常工作,但是我想使用Selenium 2來測試一些JavaScript重頁。試圖在Mac上設置Selenium + Behat
當我運行供應商/斌/貝哈特,我得到標有@javascript第一個場景該錯誤:
Curl error thrown for http POST to http://localhost:4444/wd/hub/session with params: {"desiredCapabilities":{"browserName":"firefox","version":"8","platform":"ANY","browserVersion":"8","browser":"firefox","name":"Behat test","deviceOrientation":"portrait","deviceType":"tablet","selenium-version":"2.31.0","max-duration":300},"requiredCapabilities":[]}
couldn't connect to host
我不知道爲什麼它連接到錯誤的端口,當我在定義443我的配置文件。爲什麼它說設備類型是表?這裏是我的behat.yml:
default:
paths:
features: tests/functional/features
bootstrap: tests/functional/features/bootstrap
extensions:
Behat\MinkExtension\Extension:
base_url: http://myvirtualhost.com
goutte: ~
selenium2: ~
context:
parameters:
wd_host: 127.0.0.1:4443/wd/hub
wd_capabilities: { "browser": "firefox", "version": "21"}
我有Selenium 2在127.0.0.1:4443/wd/hub正常運行。
我安裝了Firefox版本21。
這是我composer.json,我有硒2驅動程序:
{
"name": "my-website",
"description": "My Website",
"minimum-stability": "dev",
"require": {
"php": ">=5.3",
"zendframework/zendframework": "2.1.5",
"doctrine/common": "dev-master#d7987c96675e153638729383577090feed9854f1"
},
"require-dev": {
"phpunit/phpunit": "3.7.x-dev#19f1d742e0c36150001062f592c93f80aef3a9fd",
"behat/behat": "dev-develop#1f1bead31e96da5e30fd5d499d5cf66d29b68cf6",
"behat/mink": "v1.4.3",
"behat/mink-extension": "dev-master#ef2c8639ebc254f0ff6e555b7834700caf5db9c4",
"behat/mink-goutte-driver": "dev-master#v1.0.8",
"behat/mink-selenium2-driver": "v1.0.6"
}
}
非常感謝你;) –