【发布时间】:2015-02-21 18:17:36
【问题描述】:
我想做这样的事情:
// pseudocode
$this->byCssSelector('p')->setAttribute('attributename', 'attributevalue');
如何在phpunit-selenium 中做到这一点?
【问题讨论】:
标签: php selenium selenium-webdriver phpunit
我想做这样的事情:
// pseudocode
$this->byCssSelector('p')->setAttribute('attributename', 'attributevalue');
如何在phpunit-selenium 中做到这一点?
【问题讨论】:
标签: php selenium selenium-webdriver phpunit
你需要使用execute()执行javascript并使用setAttribute()设置属性:
$this->execute(array(
'script' => "document.getElementById('my_id').setAttribute('name', 'value');",
'args' => array()
));
【讨论】: