【PHPUnit Selenium Server – 更好/自定义错误处理?】教程文章相关的互联网学习教程文章

PHP – 试图在Mac上设置Selenium Behat【代码】

所以我使用无头浏览器让Behat正常工作,但我想使用Selenium 2来测试一些JavaScript重页. 当我运行vendor / bin / behat时,我在标记为@javascript的第一个场景中出现此错误:Curl error thrown for http POST to http://localhost:4444/wd/hub/session with params: {"desiredCapabilities":{"browserName":"firefox","version":"8","platform":"ANY","browserVersion":"8","browser":"firefox","name":"Behat test","deviceOrientat...

无法使用Selenium与php添加cookie到页面

我正在使用phpunit扩展phpunit-selenium使用selenium网格在我的网站上运行测试,但每当我尝试在Internet Explorer上运行测试时,我收到一条错误消息,指出:Unable to add cookie to page (WARNING: The server did not provide anystacktrace information)问题似乎源于phpunit-selenium尝试,但无法设置cookie“PHPUNIT_SELENIUM_TEST_ID”. 我找到了从here设置和删除cookie的示例代码,有趣的是链接中的代码在IE上执行得很好,显示了co...

PHPUnit Selenium Server – 更好/自定义错误处理?【代码】

我有没有办法让PHPUnit在出错后继续?例如,我有一个大型测试套件(400个步骤),我宁愿如果说,找不到元素,它也不会阻止我的脚本继续运行.解决方法:有一种更好的方法可以做到这一点.您可以重载一个方法:runTest(),而不是重载每个断言*()方法.它适用于每个断言,并且可以捕获异常:abstract class AMyTestCase extends PHPUnit_Framework_TestCase {public function runTest(){try {parent::runTest();}catch ( MyCustomException $Exc ...

Selenium服务器 – PHPUnit无法连接【代码】

我试着为PHP Unit& amp; Selenium服务器.我有一个难以置信的问题,我不知道为什么. 我使用的是最新的Selenium stand服务器2.42.2.当我运行服务器时,它显示:root@test:/home/jakub# java -jar /usr/local/bin/selenium-server-standalone-2.42.2.jar Jun 30, 2014 4:32:53 PM org.openqa.grid.selenium.GridLauncher main INFO: Launching a standalone server 16:32:53.398 INFO - Java: Oracle Corporation 24.51-b03 16:32:53.39...

php – Selenium每个测试类有多个baseUrl

我正在一个复杂的基于Web的应用程序上编写selenium脚本. 要使用useraccount,我需要首先使用一个URL注册,然后在另一个URL的管理控制台中批准该帐户. 问题是注册和管理控制台还有另一个baseURL,我需要在一个单元测试中. 但是当我在我的测试中使用setBaseUrl时,它会被忽略并使用旧的baseURL.之后我甚至打电话给start(),但没有变化…… 有没有我不知道的伎俩?我正在玩这个问题已经调试了很长一段时间,但是解耦(测试< - > RCServer)硒...

php – Selenium不会显示失败的数字行【代码】

我让Selenium服务器在MAMP本地服务器上使用PHPUnit. 当Assert失败时,失败的数字行没有显示,而是我看到一个phpunit数字行. 当我执行“仅phpunit”测试时,我可以看到失败断言的数字行. PHPUnit只测试$cd '/Applications/MAMP/htdocs/my-client/tests' && phpunit -c 'phpunit.xml' '/Applications/MAMP/htdocs/my-client/tests/controllers/homeTest.php' PHPUnit 3.6.10 by Sebastian Bergmann.Configuration read from /Applicati...

如何使用phpunit-selenium设置元素属性【代码】

我想做点什么:// pseudocode $this->byCssSelector('p')->setAttribute('attributename', 'attributevalue');在phpunit-selenium怎么做?解决方法:您需要使用execute()执行javascript并使用setAttribute()设置属性:$this->execute(array('script' => "document.getElementById('my_id').setAttribute('name', 'value');", 'args' => array() ));

windows环境下的PHP+selenium环境搭建【图】

最近想要入门自动化测试,之前也写过使用codeception进行单元测试和接口测试,UI测试部分我选择了selenium框架,接下来我们来进行相关环境的搭建。PHP环境的搭建1、进入PHP下载地址 http://windows.php.net/download 下载最新线程安全版PHP zip压缩包,解压缩后放在想要安装的路径下。(此处需要注意,win7系统不能用php7.4版本,会提示丢失 VCRUNTIME140.dll) 2、进入PHP安装目录,复制一份php.ini-development 改名为 php.ini 放...

PHPUNIT - 相关标签