Michele Delle Donne
Michele Delle Donne

Reputation: 211

Webdriver 3.14 IE11: session lost when click link/button that opens a window/popup

My Internet Explorer Options:

var optionsIE = new InternetExplorerOptions();                        
optionsIE.IntroduceInstabilityByIgnoringProtectedModeSettings = true;
optionsIE.EnsureCleanSession = true;

string IE_DRIVER_PATH = SolutionDirectory + @"\\..\\packages\\Selenium.WebDriver.IEDriver.3.14.0\\driver\\";

InternetExplorerDriverService service =
InternetExplorerDriverService.CreateDefaultService(IE_DRIVER_PATH);
service.Port = port; 
driver = new InternetExplorerDriver(service, optionsIE);

When click on link/button that opens an modal popUp, login e password are required on new window (no normal):

enter image description here

while I expect another result window.

If I use ff61, I take the correct window form:

enter image description here

Upvotes: 1

Views: 442

Answers (2)

Michele Delle Donne
Michele Delle Donne

Reputation: 211

The problem is due at command line –noframemerging used to launch IE.

In fact, this parameter sets IE session between several processes. When I click on the button that opens the popup a new process has been created. enter image description here

If I use IE in the same manual test, I take only two processes.

I tried to set up

ForceCreateProcessApi = true,
BrowserCommandLineArguments = "-framemerging"

but it doesn't work. For Prevents Internet Explorer from merging new frame processes into new system processes, a workaround is to set this option via registry key:

HKEY_CURRENT_USER\SOFTWARE\Microsoft\Internet Explorer\Main\FrameMerging\(DWORD)00000000

The feature is enabled when the value is set to (DWORD) 00000001 and disabled when the value is (DWORD) 00000000. By default, it is enabled.

Upvotes: 1

Zhi Lv
Zhi Lv

Reputation: 21636

I suppose the issue is related to the EnsureCleanSession property. When set this property to true, it will clears the system cache for all instances of Internet Explorer, even those already running when the driven instance is launched.

Upvotes: 1

Related Questions