+ _serverArguments.get(AppiumCommonArgs.PORT_NUMBER) + " \"`) do (FOR /F \"usebackq\" %b in (`TASKLIST /FI \"PID eq %a\" ^| findstr /I node.exe`) do taskkill /F /PID %a)"}; } else if (OS.isFamilyMac()) {
+ _serverArguments.get(AppiumCommonArgs.PORT_NUMBER) + " \"`) do (FOR /F \"usebackq\" %b in (`TASKLIST /FI \"PID eq %a\" ^| findstr /I node.exe`) do taskkill /F /PID %a)"}; } else if (OS.isFamilyMac()) {
/** * Search the operating system for an Appium server installation directory. * * @return A File representation to the Appium server installation * directory. */ private File searchForServerDirectory() { if (OS.isFamilyWindows()) { if (getArch().equals("32")) { return doesDirectoryExists(System.getenv("ProgramFiles") + "/Appium"); } else { // must be the x86_64 return doesDirectoryExists(System.getenv("ProgramFiles") + " (x86)/Appium"); } } else if (OS.isFamilyMac()) { return doesDirectoryExists("/Applications/Appium.app/Contents/Resources"); } // server directrory was not found. throw new ServerDirectoryNotFoundException(); }
/** * Search the operating system for an Appium server installation directory. * * @return A File representation to the Appium server installation * directory. */ private File searchForServerDirectory() { if (OS.isFamilyWindows()) { if (getArch().equals("32")) { return doesDirectoryExists(System.getenv("ProgramFiles") + "/Appium"); } else { // must be the x86_64 return doesDirectoryExists(System.getenv("ProgramFiles") + " (x86)/Appium"); } } else if (OS.isFamilyMac()) { return doesDirectoryExists("/Applications/Appium.app/Contents/Resources"); } // server directrory was not found. throw new ServerDirectoryNotFoundException(); }
} else if (OS.isFamilyMac() || OS.isFamilyUnix()) { commanddLine = new CommandLine(command.contains(" ") ? "'" + command + "'" : command); } else { commanddLine.addArgument("\"" + parameter + "\"", false); } else if (OS.isFamilyMac() || OS.isFamilyUnix()) { for (String parameter : parameters) { commanddLine.addArgument(parameter.contains(" ") ? "'" + parameter + "'" : parameter, false);
} else if (OS.isFamilyMac() || OS.isFamilyUnix()) { commanddLine = new CommandLine(command.contains(" ") ? "'" + command + "'" : command); } else { commanddLine.addArgument("\"" + parameter + "\"", false); } else if (OS.isFamilyMac() || OS.isFamilyUnix()) { for (String parameter : parameters) { commanddLine.addArgument(parameter.contains(" ") ? "'" + parameter + "'" : parameter, false);
@Override public WebDriver newInstance(DriverOptions driverOptions) { if (!OS.isFamilyMac()) throw new UnsupportedOperationException("Unsupported platform: " + Platform.getCurrent()); SafariDriverService service = setupBuilder(new SafariDriverService.Builder(), driverOptions, null).build(); SafariOptions options = newSafariOptions(driverOptions); options.merge(driverOptions.getCapabilities()); SafariDriver driver = new SafariDriver(service, options); setInitialWindowSize(driver, driverOptions); return driver; } }