Skip to content

Commit ed08538

Browse files
committed
[dotnet] Adding test configuration for Edge in IE Mode
1 parent 2250ab2 commit ed08538

File tree

2 files changed

+62
-0
lines changed

2 files changed

+62
-0
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
using OpenQA.Selenium.Remote;
2+
3+
namespace OpenQA.Selenium.IE
4+
{
5+
// This is a simple wrapper class to create an InternetExplorerDriver that
6+
// uses the enables RequireWindowFocus as the default input simplation.
7+
public class EdgeInternetExplorerModeDriver : InternetExplorerDriver
8+
{
9+
private static string servicePath = string.Empty;
10+
11+
public EdgeInternetExplorerModeDriver(InternetExplorerDriverService service)
12+
: this(service, DefaultOptions)
13+
{
14+
}
15+
16+
public EdgeInternetExplorerModeDriver(InternetExplorerDriverService service, InternetExplorerOptions options)
17+
: base(service, options)
18+
{
19+
}
20+
21+
public static string ServicePath
22+
{
23+
get { return servicePath; }
24+
set { servicePath = value; }
25+
}
26+
27+
public static InternetExplorerDriverService DefaultService
28+
{
29+
get
30+
{
31+
InternetExplorerDriverService service;
32+
if (string.IsNullOrEmpty(servicePath))
33+
{
34+
service = InternetExplorerDriverService.CreateDefaultService();
35+
}
36+
else
37+
{
38+
service = InternetExplorerDriverService.CreateDefaultService(servicePath);
39+
}
40+
41+
// For debugging purposes, one can uncomment the following lines
42+
// to generate a log from the driver executable. Please do not
43+
// commit changes to this file with these lines uncommented.
44+
// service.LogFile = @"iedriver.log";
45+
// service.LoggingLevel = InternetExplorerDriverLogLevel.Debug;
46+
return service;
47+
}
48+
}
49+
50+
public static InternetExplorerOptions DefaultOptions
51+
{
52+
get { return new InternetExplorerOptions() { RequireWindowFocus = true, UsePerProcessProxy = true, AttachToEdgeChrome = true, EdgeExecutablePath = @"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" }; }
53+
}
54+
}
55+
}

dotnet/test/common/appconfig.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,13 @@
4545
"RemoteCapabilities": "internet explorer"
4646
},
4747

48+
"EdgeIEMode": {
49+
"DriverTypeName": "OpenQA.Selenium.IE.EdgeInternetExplorerModeDriver",
50+
"AssemblyName": "WebDriver.Common.Tests",
51+
"BrowserValue": "IE",
52+
"RemoteCapabilities": "internet explorer"
53+
},
54+
4855
"Edge": {
4956
"DriverTypeName": "OpenQA.Selenium.Edge.StableChannelEdgeDriver",
5057
"AssemblyName": "WebDriver.Common.Tests",

0 commit comments

Comments
 (0)