phpunit硒自动化测试
phpunit selenium automated tests
我正在设置在网站上运行的自动测试,以确保一切正常工作。我有一个网页显示了一张记录表。
- 我想测试加载选定的网页
- 选中所选记录的复选框
- 选择"处理所选内容"按钮
- 在文本区域输入一些伪文本
- 单击"确认"保存记录
我已经完成了前3个步骤,但我仍停留在第4步。有人能帮忙吗?谢谢Conor
<?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');
}
}
?>
问题是:没有名为setField
的方法。改变
$this->setField('dlg-stateChange-notes','TEST NOTE');
至
$this->sendKeys('dlg-stateChange-notes','TEST NOTE');
如果不起作用,请尝试使用
$this->type('dlg-stateChange-notes','TEST NOTE');
//byId、byClassName、byXpath您可以设置值。
$this->byId('dlg-stateChange-notes')->value('TEST NOTE');
相关文章:
- 如何使用jquery从下拉列表(javascript)中选择192.168.3.0进行测试自动化
- phpunit硒自动化测试
- 作为自动化测试的一部分,监控特定的js事件以及执行它们所需的时间
- 使用仪器从iOS自动化测试文件进行异步调用
- webrtc 应用程序的自动化测试
- 如何为 AngularJS 设置自动化测试环境
- 如何测试 Web 应用程序的客户端,尤其是商业产品的自动化测试
- 自动化测试安卓应用程序
- 使用 javascript 准备自动化测试以测试模块
- 量角器3.0.0和黄瓜自动化测试
- 支持自动化测试的主干JS应用程序的BDD
- 通过Webdriver IO在PhantomJS中运行自动化测试
- 在web上使用脚本注入的自动化测试
- 自动化测试性能TaskWithPathArgumentsTimeout没有'不能在命令行中工作
- 使用javascript完成vbscript msgbox - Selenium -自动化测试
- 在phantomJS中的自动化测试:如何访问控制台日志
- web应用程序中的自动化测试
- Node.js+Rreact使用Jest实现自动化测试
- 如何停止ios中的自动化测试
- 自动化测试——Watir和Javascript