Skip to content

Commit

Permalink
Update .NET test to properly use remote/grid
Browse files Browse the repository at this point in the history
  • Loading branch information
jimevans committed Jun 4, 2021
1 parent b754461 commit dca5756
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Remote;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;

namespace OpenQA.Selenium.Remote
{
public class StableChannelRemoteChromeDriver : RemoteWebDriver
{
public StableChannelRemoteChromeDriver()
: base(new Uri("http://127.0.0.1:6000/wd/hub/"), new ChromeOptions())
{
this.FileDetector = new LocalFileDetector();
}
}
}
6 changes: 3 additions & 3 deletions dotnet/test/common/Environment/RemoteSeleniumServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace OpenQA.Selenium.Environment
public class RemoteSeleniumServer
{
private Process webserverProcess;
private string serverJarName = @"buck-out/gen/java/server/src/org/openqa/grid/selenium/selenium.jar";
private string serverJarName = @"java/server/src/org/openqa/selenium/grid/selenium_server_deploy.jar";
private string projectRootPath;
private bool autoStart;

Expand Down Expand Up @@ -41,14 +41,14 @@ public void Start()
string ieDriverExe = System.IO.Path.Combine(serviceDirectory, "IEDriverServer.exe");
string chromeDriverExe = System.IO.Path.Combine(serviceDirectory, "chromedriver.exe");
string geckoDriverExe = System.IO.Path.Combine(serviceDirectory, "geckodriver.exe");
string edgeDriverExe = System.IO.Path.Combine(serviceDirectory, "MicrosoftWebDriver.exe");
string edgeDriverExe = System.IO.Path.Combine(serviceDirectory, "msedgedriver.exe");
webserverProcess = new Process();
webserverProcess.StartInfo.FileName = "java.exe";
webserverProcess.StartInfo.Arguments = "-Dwebdriver.ie.driver=" + ieDriverExe
+ " -Dwebdriver.gecko.driver=" + geckoDriverExe
+ " -Dwebdriver.chrome.driver=" + chromeDriverExe
+ " -Dwebdriver.edge.driver=" + edgeDriverExe
+ " -jar " + serverJarName + " -port 6000";
+ " -jar " + serverJarName + " standalone --port 6000";
webserverProcess.StartInfo.WorkingDirectory = projectRootPath;
webserverProcess.Start();
DateTime timeout = DateTime.Now.Add(TimeSpan.FromSeconds(30));
Expand Down

0 comments on commit dca5756

Please sign in to comment.