Skip to content

Instantly share code, notes, and snippets.

@compwron
Forked from rameshbaskar/PhantomJS.java
Created December 29, 2016 18:14
Show Gist options
  • Save compwron/ed45c64c61688e11b57bdd545b35bc76 to your computer and use it in GitHub Desktop.
Save compwron/ed45c64c61688e11b57bdd545b35bc76 to your computer and use it in GitHub Desktop.

Revisions

  1. @rameshbaskar rameshbaskar created this gist Feb 21, 2014.
    18 changes: 18 additions & 0 deletions PhantoJS.java
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    // Current Implementation - Using FirefoxDriver
    @Before
    public static void before() {
    driver = new FirefoxDriver();

    admin = new AdminApi();
    user = new UserApi(driver);
    screen = new ScreenApi(driver);
    }

    // New Implementation - Using PhantomJSDriver
    @Before
    public static void before() {
    DesiredCapabilities caps = new DesiredCapabilities();
    caps.setJavascriptEnabled(true);
    caps.setCapability("takesScreenshot", true);
    driver = new PhantomJSDriver(caps);
    }