【问题标题】:Hudson + Selenium plugin - Getting HTTP error 403 when running testsHudson + Selenium 插件 - 运行测试时出现 HTTP 错误 403
【发布时间】:2010-11-30 10:18:20
【问题描述】:

我正在尝试通过 Hudson 插件(称为 sleniumhq 插件)使用 Selenium 工具测试我的应用程序。

作为概念证明,我决定针对 google 进行一个非常简单的测试,测试如下:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1  /DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link rel="selenium.base" href="" />
    <title>New Test</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
    <thead>
        <tr><td rowspan="1" colspan="3">New Test</td></tr>
    </thead>
    <tbody>
        <tr>
        <td>open</td>
        <td>/</td>
        <td></td>
        </tr>
        <tr>
        <td>waitForPageToLoad</td>
        <td>3000</td>
        <td></td>
        </tr>
        <tr>
        <td>type</td>
        <td>q</td>
        <td>selenium rc</td>
        </tr>
        <tr>
        <td>click</td>
        <td>btnG</td>
        <td></td>
        </tr>
    </tbody></table>
</body>

此测试打开 Google,然后搜索 selenium rc。

当我使用 Hudson 运行它时,我在打开的浏览器中收到 HTTP 错误 403。 Hudson 或 Selenium 没有引发特定错误。

这是我的 Hudson 配置:

浏览器:*iehta

startUrl : http://:4444/selenium-server/

suiteFile : suite.html(指向前面描述的测试的套件)

结果文件:result.html

其他:-timeout 5 -debug -browserSideLog -ensureCleanSession -trustAllSSLCertificates

htmlSuiteRunner : C:\selenium\selenium-remote-control-1.0.1\selenium-server-1.0.1\selenium-server.jar

你们是否已经遇到过这样的问题?是否与用户权限定义有关?

提前感谢您的帮助!

【问题讨论】:

    标签: selenium hudson selenium-rc


    【解决方案1】:

    我不熟悉 Hudson,但 startUrl 看起来不正确。你的意思是在那里有 Selenium RC 服务器的 IP 地址吗?例如:http://10.100.1.1:4444

    此外,如果您使用的是最新版本的 Selenium (1.0),则应将浏览器设置为 HTA 模式下的 Internet Explorer 的“*iexplore”。

    【讨论】:

    • 感谢您的回答。其实我的帖子有错误。正如你提到的,我使用的是硒服务器 IP 地址。在此 startUrl 字段中设置 Selenium IDE 使用的基本 Url 对我有用!我的意思是我必须将要测试的网站的 URL 设置为 startUrl(即:google.fr 在我的情况下)使用这个新配置,不再出现 403 错误;)感谢您的回答。
    猜你喜欢
    • 2011-01-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-02-28
    • 1970-01-01
    • 2011-03-04
    • 1970-01-01
    • 2012-05-01
    相关资源
    最近更新 更多