有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

Jenkins的java Selenium Web驱动程序

我正在研究与詹金斯一起使用Selenium WebDriver。我们有一个Jenkins服务器在Windows server 2008下运行,希望运行我所有的测试用例,我正在使用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 

Jenkins上有没有可以安装的插件

编辑

这就是我用来实例化我的驱动程序的方法,我必须使用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;
        }

共 (1) 个答案

  1. # 1 楼答案

    有什么插件可以安装在Jenkins上吗

    -不,你不需要这些插件

    这就是我用来实例化我的驱动程序的,我必须使用RemoteDriver

    我认为您需要RemoteDriver来执行测试,并且需要在GetDriver()函数中为这个RemoteDriver添加初始化

    也许你能帮我linkthis

    我的配置:

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

    所以我使用Geb进行测试,但我认为没有区别