Когда я получаю доступ к страницам в http://localhost... Selenium позволяет мне управлять окном, например, изменяя его положение, но когда я получаю доступ к странице с другого сервера, я получаю следующую ошибку:
org.openqa.selenium.NoSuchWindowException: Ошибка при получении текущего окна в sun.reflect.NativeConstructorAccessorImpl.newInstance0 (собственный метод) в sun.reflect.NativeConstructorAccessorImpl.newInstance (NativeConstructorAccessorImpl .Impl .Impl .Impl .Impl .Impl .Impl .Impl .Impl .Impl .Impl .Impl .Impl .Impl .Imp. DelegatingConstructorAccessorImpl.java:45) по адресу java.lang.reflect.Constructor.newInstance (Constructor.java:423) по адресу org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException (W3CHttpRava.p0. .remote.http. .java: 158. RemoteWebDriver $ RemoteWebDriverOptions $ RemoteWindow.setPosition (RemoteWebDriver.java:807) в seleniumie.SeleniumIE.main (SeleniumIE.java:49)
Мой код:
Point esconder = new Point(-1000,-1000);
String URL = "http://www.google.com/";
DesiredCapabilities cap = DesiredCapabilities.internetExplorer();
cap.setCapability("nativeEvents", false);
cap.setCapability("unexpectedAlertBehaviour", "accept");
cap.setCapability("ignoreProtectedModeSettings", true);
cap.setCapability("disable-popup-blocking", true);
cap.setCapability("enablePersistentHover", true);
cap.setCapability("ignoreZoomSetting", true);
cap.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS,true);
InternetExplorerOptions options = new InternetExplorerOptions();
options.merge(cap);
visor = new InternetExplorerDriver(options);
visor.get(URL);
Thread.sleep(3000);
visor.manage().window().setPosition(esconder);
Когда я запускаю последнюю строку, я получаю сообщение об ошибке
Я использую браузер IE11