From 5f707982cfff22072ab5b800fc860453acb5b0cd Mon Sep 17 00:00:00 2001 From: amihaiemil Date: Fri, 4 Nov 2016 09:48:21 +0200 Subject: [PATCH] back to phantomjs --- .../amihaiemil/charles/LiveWebPageITCase.java | 27 +++++++++---------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/src/test/java/com/amihaiemil/charles/LiveWebPageITCase.java b/src/test/java/com/amihaiemil/charles/LiveWebPageITCase.java index e39c929..b912237 100644 --- a/src/test/java/com/amihaiemil/charles/LiveWebPageITCase.java +++ b/src/test/java/com/amihaiemil/charles/LiveWebPageITCase.java @@ -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; @@ -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); } }