我正在尝试使用 xpath 获取元素数组并将结果加载到数组中,然后执行assertCount()
. 这是我拥有的代码。我是新手,我不确定为什么 elementList 是空的?
<?php
require_once('Base.php');
class FollowupTest extends Test_Base {
protected $session = null;
/**
* Asserts that the count of list elements on the page is equal
* to three utilizing an xpath expression.
*/
public function testCountListElements() {
$elementsList = $this->session->elements('xpath', '//li');
$this->assertCount(3, sizeof($elementList));
}
}