Pessoal, boa tarde!
Estou tentando executar os meus testes via Jenkins, na minha maquina local via comando Maven funciona, mas quando coloco no servidor, da erro.
Segue o erro ->
org.openqa.selenium.remote.SessionNotFoundException: Unexpected error launching Internet Explorer. IELaunchURL() returned HRESULT 80070020 ('The process cannot access the file because it is being used by another process.') for URL 'http://localhost:9748/' (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 531 milliseconds Build info: version: '2.44.0', revision: '76d78cf323ce037c5f92db6c1bba601c2ac43ad8', time: '2014-10-23 13:11:40'
Segue a minha classe que chama o Navegador ->
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;
import org.apache.http.conn.ssl.BrowserCompatHostnameVerifier;
import org.openqa.selenium.OutputType;
import org.openqa.selenium.Proxy;
import org.openqa.selenium.TakesScreenshot;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebDriverException;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.ie.InternetExplorerDriver;
import org.openqa.selenium.ie.InternetExplorerDriverLogLevel;
import org.openqa.selenium.ie.InternetExplorerDriverService;
import org.openqa.selenium.remote.BrowserType;
import org.openqa.selenium.remote.CapabilityType;
//import org.openqa.selenium.ie.InternetExplorerDriver;
//import org.openqa.selenium.remote.CapabilityType;
import org.openqa.selenium.remote.DesiredCapabilities;
import com.thoughtworks.selenium.BrowserConfigurationOptions;
import cucumber.api.Scenario;
import cucumber.api.java.After;
import cucumber.api.java.Before;
public class Config {
public static WebDriver driver;
public String urlBrowserSelecionado;
public String urlBrowser;
public String urlDriverSelecionado;
public String urlDriver;
/*
* Para uso com o browser do Chrome
*
@Before
/**
* Deleta todos os cookies e maximiza janela '
*
public void openBrowserChrome() throws FileNotFoundException {
DesiredCapabilities capabilities = DesiredCapabilities.chrome();
ChromeOptions options = new ChromeOptions();
options.addArguments("test-type");
options.addArguments("no-sandbox");
capabilities.setCapability("chrome.binary",
"C:\\Program Files (x86)\\Google\\Chrome\\Application\\52.0.2743.82");
System.setProperty("webdriver.chrome.driver", "D:\\selenium_drivers\\chrome\\chromedriver.exe");
capabilities.setCapability(ChromeOptions.CAPABILITY, options);
urlDriverSelecionado = PropertiesManager.get("url.drive.execucao");
urlBrowserSelecionado = PropertiesManager.get("url.browser.execucao");
//Inicializando arquivo de propriedades
if(urlDriverSelecionado.equals("url.drive.ie.local")){
urlDriver = PropertiesManager.get("url.driver.ie.local");
} else {
urlDriver = PropertiesManager.get("url.driver.ie.servidor");
}
//Inicializando arquivo de propriedades
if(urlBrowserSelecionado.equals("url.ie.local")){
urlBrowser = PropertiesManager.get("url.driver.ie.local");
} else {
urlBrowser = PropertiesManager.get("url.ie.servidor");
}
caps.setCapability("chrome.binary", urlBrowser);
System.setProperty("webdriver.ie.driver", urlDriver);
driver = new ChromeDriver(capabilities);
}
*/
@Before
public void openBrowserIE() throws IOException {
DesiredCapabilities caps = DesiredCapabilities.internetExplorer();
caps.setCapability(CapabilityType.ForSeleniumServer.ENSURING_CLEAN_SESSION, true);
caps.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, false);
//caps.setCapability(InternetExplorerDriver.NATIVE_EVENTS, false);
caps.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);
caps.setCapability(CapabilityType.VERSION, 9);
caps.setCapability(CapabilityType.SUPPORTS_ALERTS, false);
caps.setCapability(CapabilityType.UNEXPECTED_ALERT_BEHAVIOUR, false);
caps.setCapability(InternetExplorerDriver.ENABLE_PERSISTENT_HOVERING, false);
caps.setCapability("iedriver-version", "x64_2.41.0");
caps.setCapability("browser.helperApps.neverAsk.saveToDisk", false);
caps.setCapability(InternetExplorerDriver.IE_SWITCHES, "-private");
//caps.setCapability(InternetExplorerDriver.FORCE_CREATE_PROCESS, true);
caps.setCapability(InternetExplorerDriver.UNEXPECTED_ALERT_BEHAVIOR, false);
urlDriverSelecionado = PropertiesManager.get("url.drive.execucao");
urlBrowserSelecionado = PropertiesManager.get("url.browser.execucao");
//Inicializando arquivo de propriedades
if(urlDriverSelecionado.equals("url.drive.ie.local")){
urlDriver = PropertiesManager.get("url.driver.ie.local");
} else {
urlDriver = PropertiesManager.get("url.driver.ie.servidor");
}
//Inicializando arquivo de propriedades
if(urlBrowserSelecionado.equals("url.ie.local")){
urlBrowser = PropertiesManager.get("url.driver.ie.local");
} else {
urlBrowser = PropertiesManager.get("url.ie.servidor");
}
caps.setCapability("chrome.binary", urlBrowser);
System.setProperty("webdriver.ie.driver", urlDriver);
driver = new InternetExplorerDriver(caps);
//driver = new FirefoxDriver();
}
// @After
// /**
// * Tira screenshot caso o teste tenha falhado
// */
// public void embedScreenshot(Scenario scenario) {
//
// if (scenario.isFailed()) {
// try {
// scenario.write("Current Page URL is " + driver.getCurrentUrl());
// byte[] screenshot = ((TakesScreenshot) driver).getScreenshotAs(OutputType.BYTES);
// scenario.embed(screenshot, "image/png");
// } catch (WebDriverException somePlatformsDontSupportScreenshots) {
// System.err.println(somePlatformsDontSupportScreenshots.getMessage());
// }
// }
// driver.quit();
// }
@After
public void finaliza() {
driver.quit();
driver = null;
}
}
Alguém sabe o que pode está ocorrendo?
Muito Obrigado!