Skip to content
This repository has been archived by the owner on Apr 24, 2020. It is now read-only.

Commit

Permalink
back to phantomjs
Browse files Browse the repository at this point in the history
  • Loading branch information
amihaiemil committed Nov 4, 2016
1 parent f51ee39 commit 5f70798
Showing 1 changed file with 12 additions and 15 deletions.
27 changes: 12 additions & 15 deletions src/test/java/com/amihaiemil/charles/LiveWebPageITCase.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.phantomjs.PhantomJSDriver;
import org.openqa.selenium.phantomjs.PhantomJSDriverService;
import org.openqa.selenium.remote.DesiredCapabilities;
Expand Down Expand Up @@ -129,20 +128,18 @@ public void quitDriver() {
}

private WebDriver phantomJsDriver() {
// String phantomJsExecPath = System.getProperty("phantomjsExec");
// if("".equals(phantomJsExecPath)) {
// phantomJsExecPath = "/usr/local/bin/phantomjs";
// }
//
// DesiredCapabilities dc = new DesiredCapabilities();
// dc.setJavascriptEnabled(true);
// dc.setCapability(
// PhantomJSDriverService.PHANTOMJS_EXECUTABLE_PATH_PROPERTY,
// phantomJsExecPath
// );
// return new PhantomJSDriver(dc);
System.setProperty("webdriver.firefox.bin", "C:\\Program Files\\Mozilla Firefox\\firefox.exe");
return new FirefoxDriver();
String phantomJsExecPath = System.getProperty("phantomjsExec");
if("".equals(phantomJsExecPath)) {
phantomJsExecPath = "/usr/local/bin/phantomjs";
}

DesiredCapabilities dc = new DesiredCapabilities();
dc.setJavascriptEnabled(true);
dc.setCapability(
PhantomJSDriverService.PHANTOMJS_EXECUTABLE_PATH_PROPERTY,
phantomJsExecPath
);
return new PhantomJSDriver(dc);
}

}

0 comments on commit 5f70798

Please sign in to comment.