Mink와 Behat과 함께 Selenium2 드라이버를 사용하여 일부를 실행하고 있습니다. 수락 테스트를하고 대부분은 모든 것이 잘 진행되고 있습니다.Mink에서 XPath 오류 : '문서'에서 '평가'를 실행하지 못했습니다. 결과가 노드 집합이 아니므로 원하는 유형으로 변환 할 수 없습니다.
그러나 XPath를 사용하여 data- * 속성을 기반으로 요소를 대상으로 지정하려고 시도하고 있습니다.
나는 XPathHelper 및 FirePath을 사용했습니다 내 XPath는 그 확장의 모두에서 체크 아웃 : 표시
//html//@data-search-id='images'
올바른 요소를 대상으로. 그러나
, 나는 내가 Behat에서 다음과 같은 오류가
$el = $this->getSession()->getPage()->find('xpath', $this->getSession()->getSelectorsHandler()->selectorToXpath('xpath', "//@data-search-id='images'"));
$el->click();
FeatureContext.php에 다음 사항을 추가 할 때 : 나는 당신이 찾고있는 XPath를가 생각
invalid selector: Unable to locate an element with the xpath expression
//html//@data-search-id='images' because of the following error:
TypeError: Failed to execute 'evaluate' on 'Document':
The result is not a node set, and therefore cannot be converted
to the desired type.
정답과 설명! 문제 및 해결 방법에 대한 설명 주셔서 감사합니다. – brianrhea