gpt4 book ai didi

firefox - 运行 MTAF 时使用 selenium server 2.24.1 和 firefox 13 截屏

转载 作者:行者123 更新时间:2023-11-28 20:57:12 24 4
gpt4 key购买 nike

我正在尝试设置我的测试自动化引擎。不幸的是,当我运行我的测试并失败时,没有截屏。我在日志中找不到任何错误告诉我出了什么问题。

我正在使用:Magento 社区 1.7.0.0, Selenium 服务器 2.24.1,火狐 13.0.1,PHPUnit 3.6.11,Magento 测试自动化框架(最新版本)。Ubuntu 12.04

我的问题是:1.如何归纳问题出在哪里?2. 有谁在那个firefox和selenium版本上截图成功的吗?

最佳答案

我写了没有 magento taf 的简单测试,它一定会失败:

class WebTest extends PHPUnit_Extensions_SeleniumTestCase
{
protected $captureScreenshotOnFailure = TRUE;
protected $screenshotPath = '/home/lpp2/Pulpit/report/';
protected $screenshotUrl = '/home/lpp2/Pulpit/report/';

protected function setUp()
{
$this->setBrowser("*chrome");
$this->setBrowserUrl("http://www.google.pl/");
}

public function testMyTestCase()
{
$this->open("http://www.google.pl/");
$this->click("id=gbi4t");
$this->waitForPageToLoad("30000");
$this->type("id=Email", "user.name");
$this->type("id=Passwd", "pass");
$this->click("id=signIn");
$this->waitForPageToLoad("30000");
$this->assertEquals("Google", $this->getTitle());
}
}
?>

我的 phpunit.xml:

<phpunit>
<testsuites>
<testsuite name="Google">
<file>google.php</file>
</testsuite>
</testsuites>
<logging>
<log type="coverage-html" target="./report/coverage/" charset="UTF-8"
yui="true" highlight="false"
lowUpperBound="35" highLowerBound="70"/>
<log type="plain" target="./report/logfile.txt"/>
<log type="junit" target="./report/logfile.xml" logIncompleteSkipped="false"/>
</logging>
</phpunit>

得到了很好的截图。所以问题出在magento taf上。有些东西是禁用的。我在 .../magento_taf/lib/Mage/Selenium/TestCase.php 树行中找到了注释:

protected $captureScreenshotOnFailure = TRUE;
protected $screenshotPath = SELENIUM_TESTS_SCREENSHOTDIR;
protected $screenshotUrl = SELENIUM_TESTS_SCREENSHOTDIR;

取消注释 -> 还是不行!

编辑:好的,我已经从 github 下载了最新版本,现在可以使用了。

关于firefox - 运行 MTAF 时使用 selenium server 2.24.1 和 firefox 13 截屏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11344450/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com