我正在研究使用selenium webdriver和jenkins。我们有一个运行在WindowsServer2008下的Jenkins服务器,希望运行我的所有测试用例,我使用的是MSTest,而且我在Windows服务器上安装了VS…以下是我在服务器上安装的插件列表:

Selenium Auto Exec Server(AES) plugin
This plugin is for continuous regression test by Selenium Auto Exec Server (AES).      0.5

Jenkins Selenium Builder plugin
1.1

Hudson Seleniumhq plugin
This plugin integrates Seleniumhq to Hudson.
0.4

Selenium HTML report
0.94

SeleniumRC plugin
This plugin allows you to create Selenium server instance for each project build.
1.0

詹金斯身上有没有要安装的插件?
编辑
这是我用来实例化我的驱动程序的,我必须使用RemoteDriver
public static IWebDriver GetDriver()
{
    string _url = new Uri(Common.Url).DnsSafeHost.ToString();

     switch (Common.BrowserSelected)
     {
         case "ff":
         FirefoxProfile profile = new FirefoxProfile();
         profile.SetPreference("network.http.phishy-userpass-length", 255);
         profile.SetPreference("network.automatic-ntlm-auth.trusted-uris", _url);
         drv = new FirefoxDriver(profile);
                    break;
          case "ie":
          var options = new InternetExplorerOptions();
           options.IntroduceInstabilityByIgnoringProtectedModeSettings = true;
           DesiredCapabilities capabilities = new DesiredCapabilities();
            capabilities.SetCapability(CapabilityType.AcceptSslCertificates, true);
                    drv = new InternetExplorerDriver(options);
                    break;
                case "chrome":
                    //_driver = new ChromeDriver();
                    break;
            }
            return drv;
        }

最佳答案

詹金斯身上有没有要安装的插件?
-不,你不需要这些插件。
这是我用来实例化我的驱动程序的,我必须使用RemoteDriver
我认为需要RemoteDriver来执行测试,并且需要在RemoteDriver函数中为这个GetDriver()添加初始化。
也许你能帮上忙
我的配置:

firefox {
    capability = DesiredCapabilities.firefox()
    capability.setPlatform(Platform.LINUX)
    driver = {new RemoteWebDriver(new URL("http://some.domain:4444/wd/hub"), capability)}
}

所以我用link来测试,但我认为没有区别。

10-07 15:24