Behat, Mink 및 Selenium2를 사용하여 테스트를 실행하고 있습니다.
시나리오에서 @javascript
태그를 사용하는 예제 검색 - 자동 완성 테스트를 실행하고 있습니다.Behat + Mink - Selenium2 문제 : 'requiredCapabilities'매개 변수가 객체가 아닙니다.
Behat\MinkExtension\Context\MinkContext::visit()
'requiredCapabilities' parameter is not an object
Build info: version: '3.5.3', revision: 'a88d25fe6b', time: '2017-08-29T12:54:15.039Z'
System info: host: '73b4ecff4d3d', ip: '172.17.0.2', os.name: 'Linux', os.arch: 'amd64', os.version: '3.19.0-32-generic', java.version: '1.8.0_131'
Driver info: driver.version: unknown
remote stacktrace: stack backtrace:
0: 0x5787ed - backtrace::backtrace::trace::h59229d13f6a8837d
1: 0x578942 - backtrace::capture::Backtrace::new::h23089c033eded8f0
2: 0x5068af - <webdriver::capabilities::LegacyNewSessionParameters as webdriver::command::Parameters>::from_json::hd98a6246b0731ef9
3: 0x506e44 - <webdriver::command::NewSessionParameters as webdriver::command::Parameters>::from_json::ha19e8e984af08954
4: 0x41f249 - <webdriver::command::WebDriverMessage<U>>::from_http::h239258e4ad67ac76
5: 0x43a64e - <webdriver::server::HttpHandler<U> as hyper::server::Handler>::handle::hd20f6e9e0a69e2b4
6: 0x42c9af - hyper::server::listener::spawn_with::{{closure}}::h8fa3cf343f537777
7: 0x4092d7 - std::panicking::try::do_call::h649be53a713433eb
8: 0x5dc20a - panic_unwind::__rust_maybe_catch_panic
at /checkout/src/libpanic_unwind/lib.rs:98
9: 0x41c43e - <F as alloc::boxed::FnBox<A>>::call_box::hf41feb3b2b67541e
10: 0x5d48a4 - alloc::boxed::{{impl}}::call_once<(),()>
at /checkout/src/liballoc/boxed.rs:650
- std::sys_common::thread::start_thread
at /checkout/src/libstd/sys_common/thread.rs:21
- std::sys::imp::thread::{{impl}}::new::thread_start
at /checkout/src/libstd/sys/unix/thread.rs:84
내가 docker-selenium 및 geckodriver의 v0.18를 사용하여 Selenium2 독립형 서버 v3.5.3을 실행하고 있습니다 :
이것은 내가 얻을 예외입니다. Behat에 대한
내 구성 :
default:
context:
class: 'FeatureContext'
extensions:
Behat\MinkExtension\Extension:
base_url: '<skipped>'
goutte:
guzzle_parameters:
curl.options:
CURLOPT_SSL_VERIFYPEER: false
CURLOPT_CERTINFO: false
CURLOPT_TIMEOUT: 120
ssl.certificate_authority: false
selenium2:
wd_host: "http://127.0.0.1:4444/wd/hub"
capabilities:
browser: firefox
# acceptSslCerts: true
# marionette: true
# No context:
no_context:
paths:
bootstrap: 'NON_EXISTING_FOLDER'
filters:
tags: '[email protected]'
# Context based on inheritance:
inheritance:
context:
class: 'InheritedFeatureContext'
# Context based on traits:
traits:
paths:
bootstrap: 'features/php54_bootstrap'
context:
class: 'TraitedFeatureContext'
# Context based on subcontexting:
subcontexts:
context:
class: 'SubcontextedFeatureContext'
내가 손으로 세션을 생성 할 수 있어요 localhost:4444
에 연결합니다.
파이썬 - 셀레늄을 사용하는 경우이 코드를 실행할 수 있어요 :
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
driver = webdriver.Remote(
command_executor='http://127.0.0.1:4444/wd/hub',
desired_capabilities=DesiredCapabilities.FIREFOX
)
#driver = webdriver.Firefox()
driver.get("http://www.python.org")
assert "Python" in driver.title
elem = driver.find_element_by_name("q")
elem.clear()
elem.send_keys("pycon")
elem.send_keys(Keys.RETURN)
assert "No results found." not in driver.page_source
driver.close()
사전의 사람들에 감사드립니다.
python 패키지에도 셀렌 버전 3이 필요합니다. 셀레늄 패키지의 어떤 버전입니까? –
독립 실행 형 서버로 MinkSelenium2 드라이버 및 Selenium v3.5.3. 파이썬은 문제가 아닙니다. Behat입니다. – affo
Mink가 Selenium3과 호환되지 않는 것처럼 보입니다. 사이트에서 Selenium3이 말하는 내용을 확인할 수 있습니까? –