Qmetry中Edge IE模式异常:点击登录后弹出空白页问题排查
Qmetry 3.1.0中Edge IE模式登录按钮触发空白IE页面问题排查
问题现象
通过Qmetry运行Edge IE模式时,点击应用内的登录按钮会打开异常的空白IE页面;但脱离Qmetry使用独立Selenium代码运行时,该网站可正常访问。
独立运行的Selenium代码
System.setProperty("webdriver.ie.driver", Global.WINDOWS_USER_HOME + "\\.cache\\selenium\\IEDriverServer\\win64\\" + IEversion + "\\IEDriverServer.exe"); InternetExplorerOptions iExplorerOptions = new InternetExplorerOptions(); iExplorerOptions.setCapability(InternetExplorerDriver.FORCE_CREATE_PROCESS, true); iExplorerOptions.setCapability(InternetExplorerDriver.IE_SWITCHES, "-private"); iExplorerOptions.attachToEdgeChrome(); iExplorerOptions.ignoreZoomSettings(); iExplorerOptions.setCapability("ignoreProtectedModeSettings", true); iExplorerOptions.withEdgeExecutablePath("C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe"); return new InternetExplorerDriver(new BrowserFactory().setInternetExplorerOptions(iExplorerOptions));
Qmetry中使用的代码
String IEversion = downloadWebDriver(); System.setProperty("webdriver.ie.driver", Global.WINDOWS_USER_HOME + "\\.cache\\selenium\\IEDriverServer\\win64\\" + IEversion + "\\IEDriverServer.exe"); ConfigurationManager.getBundle().setProperty("iexplorer.additional.capabilities", "{'initialBrowserUrl':'" + Global.IE_INITIAL_BROWSERURL + "','ignoreProtectedModeSettings': true,'ignoreZoomSetting': true,'ie.browserCommandLineSwitches':'-private','ie.edgechromium':true,'ie.edgepath':'C://Program Files (x86)//Microsoft//Edge//Application//msedge.exe','ie.forceCreateProcessApi':true}"); Global.driver.set(new QAFExtendedWebDriver()); return new QAFExtendedWebDriver();
排查要点
- Capability拼写错误:Qmetry配置中的
ignoreZoomSetting少了末尾的s,正确参数名应为ignoreZoomSettings,拼写错误会导致该配置不生效,可能引发页面加载异常 - Edge IE模式绑定逻辑差异:独立代码使用
attachToEdgeChrome()原生方法绑定Edge IE模式,Qmetry中通过ie.edgechromium':true配置实现,需确认Qmetry 3.1.0对该参数的解析是否完全匹配原生Selenium逻辑,是否存在参数映射偏差 - 路径解析问题:Qmetry中Edge路径使用
//分隔,可尝试改为Java标准的双反斜杠转义格式(C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe),避免路径解析错误 - 初始URL干扰:Qmetry额外设置了
initialBrowserUrl,而独立代码未配置该参数,该初始URL可能与登录按钮触发的页面存在冲突,可尝试移除该配置后测试 - Qmetry封装层的配置覆盖:Qmetry的
QAFExtendedWebDriver可能存在全局配置覆盖自定义Capability的情况,检查项目中是否有其他全局配置文件(如application.properties)对IE驱动参数做了默认设置 - 版本兼容性:Qmetry 3.1.0版本较旧,可能对新版Edge IE模式的支持存在兼容性问题,可尝试升级Qmetry至最新稳定版,或查阅官方文档确认该版本对Edge IE模式的支持范围
内容的提问来源于stack exchange,提问作者ashok varma
相关产品推荐
相关产品推荐

