Я запускаю тест Selenium (тест запуска) ниже, чтобы подключиться к приложению, необходимо выбрать сертификат, поэтому я использовал firefox -p
и сохранил сертификат для выбранного профиля.Однако когда я запускал тест, он работал 2 раза.Теперь браузер больше не может подключиться к URL.
Система: Geckodriver:: 0.23.0 Платформа: Linux Firefox: 63.0 Селен: 3.11.0
System.setProperty(FirefoxDriver.SystemProperty.DRIVER_USE_MARIONETTE,"true");
DesiredCapabilities capabilities = DesiredCapabilities.firefox();
capabilities.setCapability("marionette", true);
ProfilesIni profile = new ProfilesIni();
FirefoxProfile profiles = profile.getProfile(profil);
FirefoxOptions options = new FirefoxOptions();
options.setProfile(profiles);
options.addPreference("marionette.logging", "{level: trace}");
options.addPreference("xpinstall.signatures.required", false);
options.addPreference("browser.startup.homepage_override.mstone", "ignore");
options.addPreference("geckodriver.logging", "{level: trace}")
driver.manage().window().maximize();
//driver.manage().timeouts().implicitlyWait(implicitwait, TimeUnit.SECONDS);
this.wait = new WebDriverWait(driver, implicitwait);
return driver;
}
Класс пакета:
@BeforeClass
public void initiate() throws Exception {
pool = Executors.newFixedThreadPool(thread);
final String GECKODRIVER_PATH = "/home/geckodriver";
if ( System.getProperty("webdriver.gecko.driver") == null)
System.setProperty("webdriver.gecko.driver", GECKODRIVER_PATH);
@Test(priority = 1, testName = "test", description = "test")
public void testCase001() throws Exception {
testSuites = execute.getScenario(sec1, firefoxDriver);
pool.invokeAll(testSuites); }
@AfterClass(alwaysRun=true)
public void terminate(){
pool.shutdown();
}
Тест запуска:
@Profildetests(Profil = "Profile1")
public class extends Suiteclass {
@Test(priority = 1, testName = "ddd", description = "dddd")
public void test() throws InterruptedException, AWTException {
remoteWebDriver.get(ExecutionProperties.getInstance().getApplication());
Thread.sleep(4000);
firefoxCertificat certificat = new
firefoxCertificat(remoteWebDriver);
Workcreation workcreation = new Workcreation(remoteWebDriver);
........}}
Я не знаю, что мне делать с этим
Stacktrace
org.openqa.selenium.WebDriverException: Reached error page: about:neterror?e=netTimeout&u=https%3A//10.114.2.119/dcfc=UTF-8&f=regular&d=Le%20serveur%20%C3%A0%20l%E2%80%99adresse%2010.114.2.119%20met%20trop%20de%20temps%20%C3%A0%20r%C3%A9pondre.
Build info: version: '3.11.0', revision: 'e59cfb3', time: '2018-03-11T20:26:55.152Z'
System info: host: 'teee', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '4.15.0-39-generic', java.version: '1.8.0_77'
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Capabilities {acceptInsecureCerts: true, browserName: firefox, browserVersion: 63.0, javascriptEnabled: true, moz:accessibilityChecks: false, moz:geckodriverVersion: 0.23.0, moz:headless: false, moz:processID: 7154, moz:profile: /tmp/rust_mozprofile.zyf9Mi..., moz:useNonSpecCompliantPointerOrigin: false, moz:webdriverClick: true, pageLoadStrategy: normal, platform: LINUX, platformName: LINUX, platformVersion: 4.15.0-39-generic, rotatable: false, setWindowRect: true, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify}
Session ID: 0ef4a7ea-b2a1-46bf-8c3d-084123976bd7
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:187)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:122)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:49)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:158)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:545)
at org.openqa.selenium.remote.RemoteWebDriver.get(RemoteWebDriver.java:273)