Skip to content

Commit b98b81d

Browse files
ermshipereteandreastt
authored andcommitted
dotnet: make PhantomJS driver more cross-platform aware
On Linux the filesystem is case-sensitive and executables don't end with ".exe". This change modifies the PhantomJSDriver to search for "phantomjs" on Unix systems while keeping the filename "PhantomJS.exe" on Windows. This allows to use the default constructor of the PhantomJSDriver class on Linux. Previously using the default c'tor resulted in an error that "PhantomJS.exe" can't be found. Signed-off-by: Andreas Tolfsen <[email protected]>
1 parent eea1ecf commit b98b81d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

dotnet/src/webdriver/PhantomJS/PhantomJSDriverService.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ namespace OpenQA.Selenium.PhantomJS
3535
[JsonObject(MemberSerialization.OptIn)]
3636
public sealed class PhantomJSDriverService : DriverService
3737
{
38-
private const string PhantomJSDriverServiceFileName = "PhantomJS.exe";
38+
private static readonly string PhantomJSDriverServiceFileName = Platform.CurrentPlatform.IsPlatformType(PlatformType.Unix) ? "phantomjs" : "PhantomJS.exe";
3939
private static readonly Uri PhantomJSDownloadUrl = new Uri("http://phantomjs.org/download.html");
4040

4141
private List<string> additionalArguments = new List<string>();

0 commit comments

Comments
 (0)