Skip to content

Instantly share code, notes, and snippets.

@rameshbaskar
Last active October 19, 2020 08:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save rameshbaskar/784419ff81f34a0c3e1e to your computer and use it in GitHub Desktop.
Save rameshbaskar/784419ff81f34a0c3e1e to your computer and use it in GitHub Desktop.
Replacing Firefox driver to PhantomJS driver
// 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);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment