我们有大量由业务分析师设计的 htmlsuite,我们希望在持续集成期间(或每天晚上)自动启动它们。问题是带有selenium-RC的机器与持续集成的机器不是同一台:
在java中,我们使用了客户端驱动程序,它工作得很好:
selenium = new DefaultSelenium(serverAddress, SERVER_PORT, browser, url);
selenium.start();
然后selenium.click(..)等..
如果我使用我在java中创建并启动的seleniumServer,我可以启动HTMLSuite,它也工作得很好:
RemoteControlConfiguration rcc = new RemoteControlConfiguration();
rcc.setPort(SelHelper.SERVER_PORT);
seleniumServer = new SeleniumServer(rcc);
seleniumServer.start();
HTMLLauncher launcher = new HTMLLauncher(seleniumServer);
如果我独立启动一个selenium服务器(例如远程服务器)并且我尝试使用htmlLauncher,我不会这样做,因为它使用我无法访问的SeleniumServer作为参数...
谁有解决办法吗?
B 计划是通过持续集成在 SSH 中启动 selenium RC 机器上的 .cmd 文件,其中包含以下内容:
java -jar "X:\01_Robot\SELENIUM_RC\selenium-server-1.0.1\selenium-server.jar" -htmlSuite "*firefox" "http://www.myapplication.com" "X:\mytestsuite.html"
但这会很丑陋,只有在我别无选择的情况下我才想这样做。
最佳答案
我终于在:https://github.com/takamori/selenium-html-client-driver/wiki上找到了“HtmlClientDriver”(类似于javaClientDriver)它解析 html selenese 并在 rc 服务器上启动命令。
关于java - 如何在远程 RC 服务器上启动 Selenium htmlSuite?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4122888/