Какие Capabilities прописать, чтобы запускать тесты в IE с любым зумом?

Поставила

case browser_InternetExplorer:
caps = DesiredCapabilities.InternetExplorer();
caps.SetCapability(“InternetExplorer.ignoreZoomSetting”, true);

Но все равно. при запуске тестов получаю ошибку:

Result Message: SetUp : System.InvalidOperationException : Unexpected error launching Internet Explorer. Browser zoom level was set to 125%. It should be set to 100% (NoSuchDriver)

В чем проблема? Хочется запускать тесты в ИЕ с разным зумом.

А если попробовать просто ignoreZoomSetting ?

Пробывала сейчас
caps.SetCapability("ignoreZoomSetting", true);
и
caps.SetCapability("InternetExplorer", "ignoreZoomSetting");

Также получаю:

Test Name:	View3x3Tile_VerifyExpectedElements
Test Outcome:	Failed
Result Message:	SetUp : System.InvalidOperationException : Unexpected error launching Internet Explorer. Browser zoom level was set to 125%. It should be set to 100% (NoSuchDriver)
Result StandardOutput:	Unable to take screenshot:Unexpected error launching Internet Explorer. Browser zoom level was set to 125%. It should be set to 100% (NoSuchDriver)

Ох ты ж, это же C#, не заметил.
Тогда зачем вообще лезть на уровень DesiredCapabilities?
В C# все конструкторы InternetExplorerDriver ориентированы на создание через InternetExplorerOptions.

Вот так примерно:

InternetExplorerOptions options = new InternetExplorerOptions();
options.IgnoreZoomLevel = true;
InternetExplorerDriver driver = new InternetExplorerDriver(options);

Так это вроде локальный браузер, а если мне нужно запустить удаленный?

То есть capabilietes мне по-любому нужны, так как браузер я вызываю так:
`RemoteWebDriver newDriver = new RemoteWebDriver(hubUri, caps);

Сделала так для локальных тестов, все бы хорошо, но…ни один элемент теперь на на странице не находится (то есть все тесты красные), что за беда! =(

System.InvalidOperationException : Unexpected error launching Internet Explorer. Browser zoom level was set to 125%. It should be set to 100% 

Вы думаете Джим так сделал просто потому, что любит цифру 100?

Native Events and Internet Explorer

As the InternetExplorerDriver is Windows-only, it attempts to use so-called “native”, or OS-level events to perform mouse and keyboard operations in the browser.

Когда вы меняете зум в IE, при этом, прося драйвер игнорить эту опцию, - это напрямую влияет на процесс получения валидных координат элементов. Потому ничего и не находится. Если хотите, чтобы вариант с игнором зума полноценно работал, нужно отключать еще и нативные ивенты. К чему это в итоге приведет, можно догадаться из продолжения выше упомянутой цитаты из официальных доков:

This is in contrast to using simulated JavaScript events for the same operations. The advantage of using native events is that it does not rely on the JavaScript sandbox, and it ensures proper JavaScript event propagation within the browser.

1 лайк