IE11上的Selenium WebDriver [英] Selenium WebDriver on IE11

查看:1693
本文介绍了IE11上的Selenium WebDriver的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用WebDriver自动化我们的webapp的回归套件,我试图让我的测试脚本在IE11上运行但没有取得任何成功。

I am using WebDriver for automating regression suite of our webapp, I have tried to get my test scripts functioning with IE11 but have not had any success.

我明白了IEDriverServer.exe当前不支持WebDriver,该问题需要Microsoft的合作,我已经尝试了对Selenium问题#6511的回复中概述的步骤。

I understand IEDriverServer.exe does not currently support WebDriver and the issue requires cooperation from Microsoft, I have tried the steps outlined in responses to Selenium issue #6511.


  1. (仅对于IE 11,您需要在目标计算机上设置一个注册表项,以便驱动程序可以保持与它创建的Internet Explorer实例的连接。对于32位Windows安装,关键是你必须在注册表编辑器中检查HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Internet Explorer \ Main \ FeatureControl \ FEATURE_BFCACHE。

  1. (For IE 11 only, you will need to set a registry entry on the target computer so that the driver can maintain a connection to the instance of Internet Explorer it creates. For 32-bit Windows installations, the key you must examine in the registry editor is HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BFCACHE.

对于64位Windows安装,关键是HKEY_LOCAL_MACHINE\SOFTWARE \Wow6432Node\Microsoft \Internet Explorer \ Main \ FeatureControl \ FEATURE_BFCACHE。请注意t FEATURE_BFCACHE子键可能存在也可能不存在,如果不存在则应创建。在此键内,创建一个名为iexplore.exe的值为0的DWORD值。)

For 64-bit Windows installations, the key is HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BFCACHE. Please note that the FEATURE_BFCACHE subkey may or may not be present, and should be created if it is not present. Inside this key, create a DWORD value named iexplore.exe with the value of 0.)

所有区域的保护模式设置相同

Protected mode settings are the same for all zones

已禁用增强保护模式。

但仍然在我在IE11中执行我的自动化脚本,它打开浏览器并获得以下异常

But still when I execute my automation scripts in IE11, It is opening browser and getting below Exception

org.openqa.selenium.ElementNotVisibleException: Received a JavaScript error attempting to 
click on the element using synthetic events.We are assuming this is because the element 
isn't displayed, but it may be due to other problems with executing JavaScript. (WARNING:
The server did not provide any stacktrace
information)

可以有人请帮我解决这个问题。我需要在IE11中执行我的自动化脚本。

Can anyone please help me in how to solve this issue. I need to execute my automation scripts in IE11.

版本细节:


  1. selenium-2.41.0

  1. selenium-2.41.0

InternetExplorerDriver服务器(32位)2.40.0.0

InternetExplorerDriver server (32-bit) 2.40.0.0

Windows 7 - 32位

Windows 7 - 32 bit


推荐答案

这是一点点有点棘手和烦人,但可能。

It is a little bit tricky and annoying, but possible.

您已经提到了所需的IE设置。它还缓存运行/使用之间的内容,您必须清除缓存和个人设置。我发现以下内容有助于确保启动时实例是干净的。这些是在实例化WebDriver时将传递到IE实例的选项。

You already mentioned the IE settings that are needed. It also cache's the content between runs/usage and you would have to clear the cache and personal settings. I have found that the following helps ensure that the instance is clean when starting. These are options that will be passed into the IE instance when instantiating the WebDriver.

本地:

    var options = new InternetExplorerOptions();
    options.IntroduceInstabilityByIgnoringProtectedModeSettings = true;
    //Clean the session before launching the browser
    options.EnsureCleanSession = true;

远程:

    capabilities = DesiredCapabilities.InternetExplorer();
    capabilities.SetCapability("ie.ensureCleanSession", true);

也许这和你提到的IE安全设置可能对你有用。

Perhaps this as well as the IE security settings you mentioned might work for you.

这篇关于IE11上的Selenium WebDriver的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆