【发布时间】:2014-09-22 04:45:45
【问题描述】:
对此仍然很陌生,我正在努力从 HTML 中获取价值。 我正在使用 Sebastian Bergmann 的 PHPUnit selenium webdriver
HTML:
<div class="col-lg-7 col-md-7">
<input type="text" id="function_function_name" name="function[function_name]" disabled="disabled" class="form-control input-sm" value="JOBSTUDENT">
</div>
我尝试了什么:
$functie = $this->webDriver->findElement(WebDriverBy::id('function_function_name'))->getText();
结果:回显是空白。(因为没有文字,不知道怎么定位值)
然后我发现了getValueText,但是当我尝试使用它时:
$functie = $this->webDriver->findElement(WebDriverBy::id('function_function_name'))->getValueText();
我得到了这个结果: PHP 致命错误:调用未定义的方法 RemoteWebElement::getValueText()
输出将回显“ JOBSTUDENT ” 我在做什么错/忘记了?
【问题讨论】: