【发布时间】:2019-12-28 00:42:36
【问题描述】:
我提前道歉,但我是初学者。 我尝试检查没有 id 或 name 的复选框。
<span class="ps-align-left">
<input type="checkbox" value="43899" style="background-color: rgb(252, 252, 252);"/>
43899
</span>
我知道如何用 selenium2driver 来做这件事。所以我像这样使用“find”函数:
public function checkOption()
{
$this->getSession()->getPage()->find('css', '.ps-align-left>input')->check();
}
它工作正常,但是当我尝试使用无头浏览器 Goutte 运行测试时出现错误:
/usr/bin/php5.6 /tmp/ide-behat.php --format PhpStormBehatFormatter /home/grzegorz/PhpstormProjects/Test/features/scenariusze.feature
Testing started at 14:48 ...
Malformed field path ""
谁能知道原因?我应该使用不同的功能吗?
【问题讨论】: