Clone
Clone

Reputation: 3668

Can I run PhantomJS without downloading the binary manually?

I am trying to make a program run on both Windows and Linux without having to download the binaries manually all the time. I wonder if it is possible to port my tester by removing the filepath somehow and adding that through maven?

    DesiredCapabilities dcap = new DesiredCapabilities();
    File path = new File("C:\\phantomjs-2.1.1-windows\\bin\\phantomjs.exe"); 
    System.setProperty("phantomjs.binary.path", path.getAbsolutePath());        
    WebDriver driver = new PhantomJSDriver(dcap);

Upvotes: 0

Views: 237

Answers (1)

kidney
kidney

Reputation: 3093

You can try using the WebDriverManager, it is a Maven dependency that automatically downloads the necessary binaries.

Upvotes: 2

Related Questions