Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/unit-testing/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Unit testing Selenium-新手在迁移之前使用旧版本_Unit Testing_Gwt_Selenium_Selenium Rc - Fatal编程技术网

Unit testing Selenium-新手在迁移之前使用旧版本

Unit testing Selenium-新手在迁移之前使用旧版本,unit-testing,gwt,selenium,selenium-rc,Unit Testing,Gwt,Selenium,Selenium Rc,我正在从事一个项目,其中它使用了旧版本的Selenium-v0.9-2服务器。我将迁移到最新的版本,但首先需要让这个版本首先工作,当然,了解它正在做什么。这是我第一次使用这个框架 因此,我使用Java1.6和FFV9在EclipseIndigo下运行 我有两个eclipse启动文件,用于启动服务器和测试 所有测试都扩展了我们定制的BaseTestCase类 BaseTestCase除了为测试设置内容之外什么都不做 下面是正在使用的配置设置 private static String TE

我正在从事一个项目,其中它使用了旧版本的Selenium-v0.9-2服务器。我将迁移到最新的版本,但首先需要让这个版本首先工作,当然,了解它正在做什么。这是我第一次使用这个框架

因此,我使用Java1.6和FFV9在EclipseIndigo下运行

我有两个eclipse启动文件,用于启动服务器和测试

所有测试都扩展了我们定制的BaseTestCase类

BaseTestCase除了为测试设置内容之外什么都不做

下面是正在使用的配置设置

    private static String TEST_SERVER = "localhost";
    private static int TEST_SERVER_PORT = 5555;
//  private static String TEST_BROWSER = "*firefox c:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe";
    private static String TEST_BROWSER = "*custom C:/Program Files (x86)/Mozilla Firefox/firefox.exe -firefoxProfileTemplate C:/temp/selenium-profile";
    public static String TARGET_URL = "http://w7001lt8001prd:9080";
    private static String TARGET_ROOT_PATH = "apps/gtgo.html";
利用第二个TEST_浏览器设置,我现在可以调出FF,但是测试仍然没有执行

在这个类的setup方法中,我们这样调用Selenium:

    selenium = new DefaultSelenium(TEST_SERVER, TEST_SERVER_PORT,TEST_BROWSER, TARGET_URL);
    selenium.start();
有一种方法用于打开根页面,然后将使用目标根路径

当我启动服务器时,这里是输出:

(server.SeleniumServer               565 ) Java: Sun Microsystems Inc. 20.4-b02
(server.SeleniumServer               566 ) OS: Windows 7 6.1 amd64
(server.SeleniumServer               686 ) v0.9.2-SNAPSHOT [2001], with Core v0.8.3-SNAPSHOT [1875]
(http.HttpServer                     684 ) Version Jetty/5.1.x
(util.Container                      74  ) Started HttpContext[/selenium-server/driver,/selenium-server/driver]
(util.Container                      74  ) Started HttpContext[/selenium-server,/selenium-server]
(util.Container                      74  ) Started HttpContext[/,/]
(http.SocketListener                 204 ) Started SocketListener on 0.0.0.0:5555
(util.Container                      74  ) Started org.mortbay.jetty.Server@77df38fd
当我启动测试套件时,这里是输出

(util.Credential                     60  ) Checking Resource aliases
(server.SeleniumDriverResourceHandler 391 ) Command request: getNewBrowserSession[*custom C:/Program Files (x86)/Mozilla Firefox/firefox.exe -firefoxProfileTemplate C:/temp/selenium-profile, http://w7001lt8001prd:9080] on session null
(server.SeleniumDriverResourceHandler 586 ) Launching session 605798
FF启动了,但我看到一个标签,上面写着它无法连接:Firefox无法连接到服务器w7001lt8001prd:9080


任何关于如何使其工作的指导。

事实证明,为了使其工作正常,需要安装FireFox的正确版本-4.0或更低版本,同时将FireFox主目录放入路径中。完成后,我现在可以运行测试套件了。下一步-迁移到版本2