Skip to content

Commit 364187a

Browse files
committed
Updating .NET remote tests to pass path to IEDriverServer.exe
1 parent 3acb98b commit 364187a

File tree

2 files changed

+24
-13
lines changed

2 files changed

+24
-13
lines changed

dotnet/test/common/Environment/EnvironmentManager.cs

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,7 @@ private EnvironmentManager()
3131

3232
urlBuilder = new UrlBuilder();
3333

34-
Assembly executingAssembly = Assembly.GetExecutingAssembly();
35-
string assemblyLocation = executingAssembly.Location;
36-
37-
// If we're shadow copying,. fiddle with
38-
// the codebase instead
39-
if (AppDomain.CurrentDomain.ShadowCopyFiles)
40-
{
41-
Uri uri = new Uri(executingAssembly.CodeBase);
42-
assemblyLocation = uri.LocalPath;
43-
}
44-
45-
string currentDirectory = Path.GetDirectoryName(assemblyLocation);
34+
string currentDirectory = this.CurrentDirectory;
4635
DirectoryInfo info = new DirectoryInfo(currentDirectory);
4736
while (info != info.Root && string.Compare(info.Name, "build", StringComparison.OrdinalIgnoreCase) != 0)
4837
{
@@ -80,6 +69,26 @@ public Browser Browser
8069
get { return browser; }
8170
}
8271

72+
public string CurrentDirectory
73+
{
74+
get
75+
{
76+
Assembly executingAssembly = Assembly.GetExecutingAssembly();
77+
string assemblyLocation = executingAssembly.Location;
78+
79+
// If we're shadow copying,. fiddle with
80+
// the codebase instead
81+
if (AppDomain.CurrentDomain.ShadowCopyFiles)
82+
{
83+
Uri uri = new Uri(executingAssembly.CodeBase);
84+
assemblyLocation = uri.LocalPath;
85+
}
86+
87+
string currentDirectory = Path.GetDirectoryName(assemblyLocation);
88+
return currentDirectory;
89+
}
90+
}
91+
8392
public TestWebServer WebServer
8493
{
8594
get { return webServer; }

dotnet/test/common/Environment/RemoteSeleniumServer.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@ public void Start()
2323
{
2424
if (autoStart && (webserverProcess == null || webserverProcess.HasExited))
2525
{
26+
string currentDirectory = EnvironmentManager.Instance.CurrentDirectory;
27+
string ieDriverExe = System.IO.Path.Combine(currentDirectory, "IEDriverServer.exe");
2628
webserverProcess = new Process();
2729
webserverProcess.StartInfo.FileName = "java.exe";
28-
webserverProcess.StartInfo.Arguments = "-jar " + serverJarName + " -port 6000";
30+
webserverProcess.StartInfo.Arguments = "-Dwebdriver.ie.driver=" + ieDriverExe + " -jar " + serverJarName + " -port 6000";
2931
webserverProcess.StartInfo.WorkingDirectory = projectRootPath;
3032
webserverProcess.Start();
3133
DateTime timeout = DateTime.Now.Add(TimeSpan.FromSeconds(30));

0 commit comments

Comments
 (0)