Webdriver 3.14 IE11:单击打开窗口/弹出窗口的链接/按钮时,会话丢失 [英] Webdriver 3.14 IE11: session lost when click link/button that opens a window/popup
问题描述
我的Internet Explorer选项:
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.
如果我使用ff61,则采用正确的窗口形式:
If I use ff61, I take the correct window form:
推荐答案
问题出在用于启动 IE 的命令行 –noframemerging >.
The problem is due at command line –noframemerging used to launch IE.
实际上,此参数设置了多个进程之间的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.
如果我在相同的手动测试中使用IE,则我只会执行两个过程.
If I use IE in the same manual test, I take only two processes.
我尝试设置
ForceCreateProcessApi = true,
BrowserCommandLineArguments = "-framemerging"
但是它不起作用.对于防止Internet Explorer将新的框架进程合并到新的系统进程",一种解决方法是通过注册表项设置此选项:
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
当该值设置为(DWORD)00000001时启用此功能,而当该值是(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.
这篇关于Webdriver 3.14 IE11:单击打开窗口/弹出窗口的链接/按钮时,会话丢失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!