Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
656 views
in Technique[技术] by (71.8m points)

internet explorer - Selenium WebDriver on 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.

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. (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_MACHINESOFTWAREMicrosoftInternet ExplorerMainFeatureControlFEATURE_BFCACHE.

    For 64-bit Windows installations, the key is HKEY_LOCAL_MACHINESOFTWAREWow6432NodeMicrosoftInternet ExplorerMainFeatureControlFEATURE_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.)

  2. Protected mode settings are the same for all zones

  3. Enhanced Protected Mode is disabled.

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)

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

Version Details:

  1. selenium-2.41.0

  2. InternetExplorerDriver server (32-bit) 2.40.0.0

  3. Windows 7 - 32 bit

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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

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.

Local:

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

Remote:

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

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...