Skip to content

Platform specifics

jpeterka edited this page Aug 22, 2013 · 2 revisions

From time to time you need to customize test behaviour based on specific platforms. You can use Utils class providing simple test if you're running expected platform.

Customizing your code based on platform

import org.eclipse.core.runtime.Platform;
import org.jboss.reddeer.swt.util;

// now I need to customize
if (Utils.isRunningOS(OS.MACOSX) {
  // do osx customized code
} else if (Utils.isRunningOS(OS.WINDOWS) {
  // do windows customized code
} else {
  //
}
Clone this wiki locally