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

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

Introduction

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

Prototype

public void setEnvironmentVariable(String name, String value) 

Source Link

Document

Adds the specified environment variable.

Usage

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());
    }// ww w .j  a v a2s .c  o  m

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

    return command;
}