Skip to content

Commit

Permalink
dotnet: make PhantomJS driver more cross-platform aware
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
ermshiperete authored and andreastt committed Mar 2, 2015
1 parent eea1ecf commit b98b81d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dotnet/src/webdriver/PhantomJS/PhantomJSDriverService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ namespace OpenQA.Selenium.PhantomJS
[JsonObject(MemberSerialization.OptIn)]
public sealed class PhantomJSDriverService : DriverService
{
private const string PhantomJSDriverServiceFileName = "PhantomJS.exe";
private static readonly string PhantomJSDriverServiceFileName = Platform.CurrentPlatform.IsPlatformType(PlatformType.Unix) ? "phantomjs" : "PhantomJS.exe";
private static readonly Uri PhantomJSDownloadUrl = new Uri("http://phantomjs.org/download.html");

private List<string> additionalArguments = new List<string>();
Expand Down

0 comments on commit b98b81d

Please sign in to comment.