I am trying to use Selenium stanalone 3 beta4.jar + FireFox48 + Geckodriver on a RD machined and below are problem I am observing :
i) I am not able to bypass or Ignore the Certificate Security Error for my application below is the piece of code I am using.
ii) And I want to invoke the custom or default firefox profile on the basis on user input, but this also does not work If i trigger the Automation suite from Jenkins(linux machine) I observed that each time i trigger the suite it creates a New FireFox profile rather than invoking the default or custom value which I am passing from Code. However, If I call the same Test suite from Eclipse which is installed on a Windows machine the firefox profile value gets picked as per code.
Note: I am using Remote Desktop to execute my Test Suite,which means my application will be invoked on a RD and all execution will happned there only calling part I can want to do from Jenkins (Linux machine).
Below is piece of code I am using:
if(browser.contains("FIREFOX") || browser.equalsIgnoreCase("firefox") || browser.contains("mozilla"))
{
FirefoxProfile profile = new FirefoxProfile();
ProfilesIni allProfiles = new ProfilesIni();
capability = DesiredCapabilities.firefox();
capability.setCapability("marionette", true);
/* If Profile value is passed i.e. Selenium_Default profile is not going to be used, user wants to use some custom profile*/
if(!browserProfile.equalsIgnoreCase("SELENIUM_DEFAULT") || !browserProfile.equalsIgnoreCase("default"))
{
profile = allProfiles.getProfile(browserProfile);
logger.debug("Profile passed : " + profile);
capability.setCapability(FirefoxDriver.PROFILE, profile);
}
else
{
/*Handling case for default profile*/
profile = allProfiles.getProfile("default");
logger.debug("Profile passed : " + profile);
capability.setCapability(FirefoxDriver.PROFILE, profile);
}
logger.debug("Profile :" + profile);
profile.setAcceptUntrustedCertificates(true);
profile.setAssumeUntrustedCertificateIssuer(false);
}
browserDriver = new RemoteWebDriver(new URL(nodeAddress), capability);
browserDriver.manage().timeouts().pageLoadTimeout(1000, TimeUnit.SECONDS);
browserDriver.manage().timeouts().implicitlyWait(90, TimeUnit.SECONDS);
browserDriver.manage().window().maximize();
browserDriver.get(applicationUrl);
logger.info("WebDriver successfully defined with Session ID:" + browserDriver.getSessionId() + ", Page Title:" + browserDriver.getTitle() + " and URL: " + browserDriver.getCurrentUrl());