Skip to content

Commit 1976dbe

Browse files
authored
Adding ignore process match for IE Mode across bindings (#12279)
Adding ignore process match for IE Mode Useful when IE Mode on Edge is launched from and admin window. The caveat is that only one Edge browser should be running on the host.
1 parent 7f28ee0 commit 1976dbe

5 files changed

Lines changed: 42 additions & 2 deletions

File tree

dotnet/src/webdriver/IE/InternetExplorerOptions.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ public class InternetExplorerOptions : DriverOptions
9292
private const string EdgeExecutablePathCapability = "ie.edgepath";
9393
private const string LegacyFileUploadDialogHandlingCapability = "ie.useLegacyFileUploadDialogHandling";
9494
private const string AttachToEdgeChromeCapability = "ie.edgechromium";
95+
private const string IgnoreProcessMatchCapability = "ie.ignoreprocessmatch";
9596

9697
private bool ignoreProtectedModeSettings;
9798
private bool ignoreZoomLevel;
@@ -105,6 +106,7 @@ public class InternetExplorerOptions : DriverOptions
105106
private bool enableFullPageScreenshot = true;
106107
private bool legacyFileUploadDialogHandling;
107108
private bool attachToEdgeChrome;
109+
private bool ignoreProcessMatch;
108110
private TimeSpan browserAttachTimeout = TimeSpan.MinValue;
109111
private TimeSpan fileUploadDialogTimeout = TimeSpan.MinValue;
110112
private string initialBrowserUrl = string.Empty;
@@ -140,6 +142,7 @@ public InternetExplorerOptions() : base()
140142
this.AddKnownCapabilityName(LegacyFileUploadDialogHandlingCapability, "LegacyFileUploadDialogHanlding property");
141143
this.AddKnownCapabilityName(AttachToEdgeChromeCapability, "AttachToEdgeChrome property");
142144
this.AddKnownCapabilityName(EdgeExecutablePathCapability, "EdgeExecutablePath property");
145+
this.AddKnownCapabilityName(IgnoreProcessMatchCapability, "IgnoreProcessMatch property");
143146
}
144147

145148
/// <summary>
@@ -309,6 +312,15 @@ public bool AttachToEdgeChrome
309312
set { this.attachToEdgeChrome = value; }
310313
}
311314

315+
/// <summary>
316+
/// Gets or sets a value indicating whether to ignore process id match with IE Mode on Edge.
317+
/// </summary>
318+
public bool IgnoreProcessMatch
319+
{
320+
get { return this.ignoreProcessMatch; }
321+
set { this.ignoreProcessMatch = value; }
322+
}
323+
312324
/// <summary>
313325
/// Gets or sets the path to the Edge Browser Executable.
314326
/// </summary>
@@ -442,6 +454,11 @@ private Dictionary<string, object> BuildInternetExplorerOptionsDictionary()
442454
internetExplorerOptionsDictionary[AttachToEdgeChromeCapability] = true;
443455
}
444456

457+
if (this.ignoreProcessMatch)
458+
{
459+
internetExplorerOptionsDictionary[IgnoreProcessMatchCapability] = true;
460+
}
461+
445462
if (!string.IsNullOrEmpty(this.edgeExecutablePath))
446463
{
447464
internetExplorerOptionsDictionary[EdgeExecutablePathCapability] = this.edgeExecutablePath;

java/src/org/openqa/selenium/ie/InternetExplorerOptions.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ public class InternetExplorerOptions extends AbstractDriverOptions<InternetExplo
6767
"ie.useLegacyFileUploadDialogHandling";
6868
private static final String ATTACH_TO_EDGE_CHROME = "ie.edgechromium";
6969
private static final String EDGE_EXECUTABLE_PATH = "ie.edgepath";
70+
private static final String IGNORE_PROCESS_MATCH = "ie.ignoreprocessmatch";
7071

7172
private static final List<String> CAPABILITY_NAMES =
7273
Arrays.asList(
@@ -87,7 +88,8 @@ public class InternetExplorerOptions extends AbstractDriverOptions<InternetExplo
8788
NATIVE_EVENTS,
8889
LEGACY_FILE_UPLOAD_DIALOG_HANDLING,
8990
ATTACH_TO_EDGE_CHROME,
90-
EDGE_EXECUTABLE_PATH);
91+
EDGE_EXECUTABLE_PATH,
92+
IGNORE_PROCESS_MATCH);
9193

9294
private final Map<String, Object> ieOptions = new HashMap<>();
9395

@@ -220,6 +222,10 @@ public InternetExplorerOptions attachToEdgeChrome() {
220222
return amend(ATTACH_TO_EDGE_CHROME, true);
221223
}
222224

225+
public InternetExplorerOptions ignoreProcessMatch() {
226+
return amend(IGNORE_PROCESS_MATCH, true);
227+
}
228+
223229
public InternetExplorerOptions withEdgeExecutablePath(String path) {
224230
return amend(EDGE_EXECUTABLE_PATH, path);
225231
}

javascript/node/selenium-webdriver/ie.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ const Key = {
8383
FILE_UPLOAD_DIALOG_TIMEOUT: 'ie.fileUploadDialogTimeout',
8484
ATTACH_TO_EDGE_CHROMIUM: 'ie.edgechromium',
8585
EDGE_EXECUTABLE_PATH: 'ie.edgepath',
86+
IGNORE_PROCESS_MATCH: 'ie.ignoreprocessmatch',
8687
}
8788

8889
/**

py/selenium/webdriver/ie/options.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ class Options(ArgOptions):
4646
USE_LEGACY_FILE_UPLOAD_DIALOG_HANDLING = "ie.useLegacyFileUploadDialogHandling"
4747
ATTACH_TO_EDGE_CHROME = "ie.edgechromium"
4848
EDGE_EXECUTABLE_PATH = "ie.edgepath"
49+
IGNORE_PROCESS_MATCH = "ie.ignoreprocessmatch"
4950

5051
def __init__(self) -> None:
5152
super().__init__()
@@ -289,6 +290,20 @@ def attach_to_edge_chrome(self, value: bool) -> None:
289290
"""
290291
self._options[self.ATTACH_TO_EDGE_CHROME] = value
291292

293+
@property
294+
def ignore_process_match(self) -> bool:
295+
""":Returns: The options ignore process match when using IE Mode value"""
296+
return self._options.get(self.IGNORE_PROCESS_MATCH)
297+
298+
@ignore_process_match.setter
299+
def ignore_process_match(self, value: bool) -> None:
300+
"""Sets the options ignore process match when using IE Mode value.
301+
302+
:Args:
303+
- value: boolean value
304+
"""
305+
self._options[self.IGNORE_PROCESS_MATCH] = value
306+
292307
@property
293308
def edge_executable_path(self) -> str:
294309
""":Returns: The options Edge Executable Path value"""

rb/lib/selenium/webdriver/ie/options.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ class Options < WebDriver::Options
4141
use_per_process_proxy: 'ie.usePerProcessProxy',
4242
use_legacy_file_upload_dialog_handling: 'ie.useLegacyFileUploadDialogHandling',
4343
attach_to_edge_chrome: 'ie.edgechromium',
44-
edge_executable_path: 'ie.edgepath'
44+
edge_executable_path: 'ie.edgepath',
45+
ignore_process_match: 'ie.ignoreprocessmatch',
4546
}.freeze
4647
BROWSER = 'internet explorer'
4748

0 commit comments

Comments
 (0)