c# - Multiple IE web-drivers : session lost when click link/button that opens a popup window
问题描述
I run multiple (2) IE web-drivers together.(for user side and admin side tests)
When the InternetExplorer WebDriver click on link/button that opens an modal popup, login page are opened on new window (abnormal).
When the ie webdriver popup the window , I can see for a fraction of a second the correct address the browser should load (in URL line) , but immediatly it changed to the login url, and required enter username and password.
I found the same problem in this link,
I made the solution there, but I still have not solved the problem, and I get an entry window instead of the expected window.
see this screenshot
- My IE version is 11.
- My Selenium.WebDriver is 3.141.0.0
- My ie webdriver is IEDriverServer_x64_3.141.5
My InternetExplorerOptions:
private static InternetExplorerOptions ieOptions = new InternetExplorerOptions
{
EnsureCleanSession = true ,
EnableNativeEvents = true ,
RequireWindowFocus = true ,
EnablePersistentHover = true ,
ForceCreateProcessApi = true ,
BrowserCommandLineArguments = "-framemerging -private"
};
I added the registry keys:
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Internet Explorer\Main\FrameMerging\(DWORD)00000000
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Internet Explorer\Main\TabProcGrowth\(DWORD)00000000
HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BFCACHE\iexplorer.exe\(DWORD)00000000
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BFCACHE\iexplorer.exe\(DWORD)00000000
Edited:
By the Deepak-MSFT references, I understand that the issue caused by more than one IE web-driver instances.
I tried to kill the IE driver also by adding the ConfirmCleanSession = true
option to the code, and also manually by running of the following statements from the command line (before running the test);
taskkill / F / IM iexplore.exe / T
taskkill / F / IM IEDriverServer.exe / T
But it did not help once I set 2 IE web-drivers to work together.
(When I tried to run the test only on one driver - it worked great!)
I would appreciate help in solving the problem!
解决方案
这个问题是由于 IE 本身的怪癖以及驱动程序如何为浏览器创建弹出窗口。
解决方法是确保在启动与驱动程序的会话时没有运行 iexplore.exe 进程。
参考:
推荐阅读
- json - 如何在 swift 4 中使用 Graphql 获取 json 值数组?
- java - 实体类中的所有实例变量是否都在数据库中持久化?
- android - 如何在反应原生 ios 设备中读取通话记录或通话记录?
- spring - 使用 Spring 实现用户通知
- react-native - undefined 不是一个对象(evaluting_'this2.pros.navigation')
- r - 以下对象被“package:ggplot2”屏蔽:
- javascript - 在 Rails 中获取 Highcharts 数据的正确方法是什么
- javascript - 如何在循环函数中过滤另一个过滤器
- php - 从我的内部存储 android 手机 6.0.0 读取文件
- android - Admob 的实时广告未显示