Selenium WebDriver with Jenkins

允我心安 提交于 2019-12-12 14:12:13

问题


I'm looking into using Selenium WebDriver with Jenkins. We have a Jenkins server running under Windows Server 2008 and would like to run all my test cases and I'm using mstest and also i have installed VS on the windows server... Here is the list of plugin I have installed on my server:

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 

Are there any plugins to installed on Jenkins?

EDIT

This is what I am using to instantiated my driver, do I have to use 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:


Are there any plugins to installed on Jenkins?

-No, you do not need these plugins.

This is what I am using to instantiated my driver, do I have to use RemoteDriver?

I think you need RemoteDriver for executing your test, and you need add initialization for this RemoteDriver in GetDriver() function.

May be you help this link and this

My Config:

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

So I use Geb for testing, but I think there is no difference.



来源:https://stackoverflow.com/questions/15509666/selenium-webdriver-with-jenkins

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!