嗨,我已经从事此工作2天了,在这里我真的需要一些帮助。我在这里提到了许多答案,但没有找到解决方案。我一直在尝试使用硒和铬扩展名设置behat。但是没有这样做。任何帮助将不胜感激。谢谢。我的功能文件上的错误如下:
@javascript
Scenario: Test the add group functionality invalid number of parent groups # features/groups.feature:28
Given I am on homepage # FeatureContext::iAmOnHomepage()
Could not open connection: Unable to create new service: ChromeDriverService
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
System info: host: 'Digitals-iMac.local', ip: '10.18.1.204', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.14.3', java.version: '11.0.1'
Driver info: driver.version: unknown (Behat\Mink\Exception\DriverException)
When I will login as globaladmin # FeatureContext::iWillLoginAsGlobaladmin()
Then I should see "groups" # FeatureContext::assertPageContainsText()
Then I click "Groups" # FeatureContext::assertClick()
Then I click "Add group" # FeatureContext::assertClick()
When I fill in "edit-label-0-value" with "Group1" # FeatureContext::fillField()
When I fill in "edit-groups-target-id" with "Echidnet, Group1" # FeatureContext::fillField()
Then I press "Create group and become a member" # FeatureContext::pressButton()
Then I should see "Error message" # FeatureContext::assertPageContainsText()
--- Failed scenarios:
features/groups.feature:4
features/groups.feature:16
features/groups.feature:28
这是我的behat.yml文件
default:
suites:
default:
path: %paths.base%/features/bootstrap
contexts:
- FeatureContext
extensions:
Behat\MinkExtension:
base_url: http://somesite.com/
javascript_session: chrome
selenium2:
wd_host: "http://somesite.com/"
browser: chromedriver
capabilities: { "browserName": "chrome", "browser": "chrome", "version": "65", 'chrome': {'switches':['--no-sandbox', '--headless']}}
browser_name: chrome
sessions:
default:
goutte: ~
chrome:
selenium2:
browser: chrome
这是我执行时硒的独立提示(当我尝试使用chrome时,它说浏览器是firefox。我不确定如何解决这个问题,甚至不确定在哪里提到过要使用firefox):
09:43:27.074 INFO [ActiveSessionFactory.lambda$apply$11] - Matched factory org.openqa.selenium.grid.session.remote.ServicedSession$Factory (provider: org.openqa.selenium.chrome.ChromeDriverService)
09:43:27.089 INFO [ActiveSessionFactory.apply] - Capabilities are: {
"browser": "firefox",
"browserName": "chrome",
"ignoreZoomSetting": false,
"name": "Behat feature suite",
"tags": [
"Digitals-iMac.local",
"PHP 7.2.15"
]
}
我也可以提供其他文件,例如我的特征或特征上下文文件,但我认为这不是必需的。我被困住了并且有最后期限,如果有人可以帮助我设置铬和硒,那将不胜感激。我确实看到了一些需要我更新驱动程序的解决方案,我也确实更新了驱动程序。但不确定他们是否已对此进行更新。我对behat和.yml编码非常陌生。所以请耐心等待并帮助我。 谢谢