Bor*_*ard 4 php selenium phpunit selenium-webdriver
我想做点什么:
// pseudocode
$this->byCssSelector('p')->setAttribute('attributename', 'attributevalue');
Run Code Online (Sandbox Code Playgroud)
如何在phpunit-selenium中做到这一点?
你需要用来execute()
执行javascript并使用setAttribute()
以下方法设置属性:
$this->execute(array(
'script' => "document.getElementById('my_id').setAttribute('name', 'value');",
'args' => array()
));
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
1270 次 |
最近记录: |