Example usage for org.openqa.selenium.os CommandLine setDynamicLibraryPath

List of usage examples for org.openqa.selenium.os CommandLine setDynamicLibraryPath

Introduction

In this page you can find the example usage for org.openqa.selenium.os CommandLine setDynamicLibraryPath.

Prototype

public void setDynamicLibraryPath(String newLibraryPath) 

Source Link

Usage

From source file:com.atlassian.selenium.browsers.firefox.DisplayAwareFirefoxChromeLauncher.java

License:Apache License

private void populateCustomProfileDirectory(String profilePath) {
    /*//from   ww  w  .j  ava  2s. c o m
     * The first time we launch Firefox with an empty profile directory, Firefox will launch itself,
     * populate the profile directory, then kill/relaunch itself, so our process handle goes out of
     * date. So, the first time we launch Firefox, we'll start it up at an URL that will immediately
     * shut itself down.
     */
    CommandLine command = prepareCommand(browserInstallation.launcherFilePath(), "-profile", profilePath,
            "-silent");
    command.setDynamicLibraryPath(browserInstallation.libraryPath());
    log.info("Preparing Firefox profile...");
    command.execute();
    try {
        waitForFullProfileToBeCreated(20 * 1000);
    } catch (RuntimeException e) {
        command.destroy();
        throw e;
    }
}

From source file:com.atlassian.selenium.browsers.firefox.DisplayAwareFirefoxChromeLauncher.java

License:Apache License

protected CommandLine prepareCommand(String... commands) {
    CommandLine command = new CommandLine(commands);
    command.setEnvironmentVariable("MOZ_NO_REMOTE", "1");

    // don't set the library path on Snow Leopard
    Platform platform = Platform.getCurrent();
    if (!platform.is(Platform.MAC) || ((platform.is(Platform.MAC)) && platform.getMajorVersion() <= 10
            && platform.getMinorVersion() <= 5)) {
        command.setDynamicLibraryPath(browserInstallation.libraryPath());
    }//from   w  w w .j  a  v  a 2 s  .  c  om

    if (System.getProperty("DISPLAY") != null) {
        command.setEnvironmentVariable("DISPLAY", System.getProperty("DISPLAY"));
    }

    return command;
}