我正在设置自动化测试以在网站上运行,以确保一切仍能正常运行。我有一个显示记录表的网页。
我已经完成了前3个步骤,但我仍然坚持第4步。有人可以帮帮忙吗? 谢谢 康纳
<?php
class AdminUserProcessSelectedNote extends PHPUnit_Extensions_Selenium2TestCase{
public function setUp()
{
$this->setHost('localhost'); // Set the hostname for the connection to the Selenium server.
$this->setPort(4444); // set port # for connection to selenium server
$this->setBrowser('firefox'); // set the browser to be used
$this->setBrowserUrl('http://www.myhost.com/'); // set base URL for tests
}
public function testAdminUserProcessSelectedNoteSelectReq3()
{
$this->url('index.php'); // Set the URL to access the page
// Select the specific checkbox with the Id
$viewReqsCheckbox = $this->byId('jqg_requestGrid_request_4506');
$viewReqsCheckbox ->click();
// Now, Select the Process Selected button
$processSelectedBtn = $this -> byId('processStateChangeButton');
$processSelectedBtn ->click();
// Make a note and Confirm
$this->byName('dlg-stateChange-notes');
$this->setField('dlg-stateChange-notes','TEST NOTE');
$this->click('Confirm');
}
}
?>
答案 0 :(得分:0)
问题是:没有名为setField
的方法。变化...
$this->setField('dlg-stateChange-notes','TEST NOTE');
到
$this->sendKeys('dlg-stateChange-notes','TEST NOTE');
如果不起作用,请尝试使用
$this->type('dlg-stateChange-notes','TEST NOTE');
答案 1 :(得分:0)
// byId,byClassName,byXpath你可以设置值。
$this->byId('dlg-stateChange-notes')->value('TEST NOTE');