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

荒凉一梦 提交于 2019-12-23 03:23:15

问题


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):

while I expect another result window.

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


回答1:


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.




回答2:


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.

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.



来源:https://stackoverflow.com/questions/53008860/webdriver-3-14-ie11-session-lost-when-click-link-button-that-opens-a-window-pop

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!