当前位置: 首页>>代码示例>>Java>>正文


Java Platform.getCurrent方法代码示例

本文整理汇总了Java中org.openqa.selenium.Platform.getCurrent方法的典型用法代码示例。如果您正苦于以下问题:Java Platform.getCurrent方法的具体用法?Java Platform.getCurrent怎么用?Java Platform.getCurrent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.openqa.selenium.Platform的用法示例。


在下文中一共展示了Platform.getCurrent方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onPosix

import org.openqa.selenium.Platform; //导入方法依赖的package包/类
private boolean onPosix() {
	Platform current = Platform.getCurrent();
	switch (current) {
		case LINUX:
		case UNIX:
			return true;
		case MAC:
		case ANY:
		case VISTA:
		case WINDOWS:
		case XP:
		case ANDROID:
		default:
			return false;
	}
}
 
开发者ID:aminmf,项目名称:crawljax,代码行数:17,代码来源:FirefoxLinuxCrash.java

示例2: javaHome

import org.openqa.selenium.Platform; //导入方法依赖的package包/类
public static String javaHome() {
  if (javaHome == null) {
    // Sniff JAVA_HOME first
    javaHome = System.getenv("JAVA_HOME");

    // If that's not present, and we're on a Mac...
    if (javaHome == null && Platform.getCurrent() == MAC) {
      try {
        javaHome = ShellCommand.exec(new CommandLine("/usr/libexec/java_home"));
        if (javaHome != null) {
          javaHome = javaHome.replaceAll("\\r|\\n", "");
        }

      } catch (ShellCommandException e) {}
    }
    // Finally, check java.home, though this may point to a JRE.
    if (javaHome == null) {
      javaHome = System.getProperty("java.home");
    }
  }
  return javaHome;
}
 
开发者ID:selendroid,项目名称:selendroid,代码行数:23,代码来源:JavaSdk.java

示例3: failsWhenRequestingANonJavaDriver

import org.openqa.selenium.Platform; //导入方法依赖的package包/类
public void failsWhenRequestingANonJavaDriver() throws Throwable {
    DesiredCapabilities caps = new DesiredCapabilities("xjava", "1.0", Platform.getCurrent());
    try {
        driver = new JavaDriver(caps, caps);
        throw new MissingException(SessionNotCreatedException.class);
    } catch (SessionNotCreatedException e) {
    }
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:9,代码来源:JavaDriverTest.java

示例4: failsWhenRequestingUnsupportedCapability

import org.openqa.selenium.Platform; //导入方法依赖的package包/类
public void failsWhenRequestingUnsupportedCapability() throws Throwable {
    DesiredCapabilities caps = new DesiredCapabilities("java", "1.0", Platform.getCurrent());
    caps.setCapability("rotatable", true);
    try {
        driver = new JavaDriver(caps, caps);
        throw new MissingException(SessionNotCreatedException.class);
    } catch (SessionNotCreatedException e) {
    }
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:10,代码来源:JavaDriverTest.java

示例5: succeedsWhenRequestingNativeEventsCapability

import org.openqa.selenium.Platform; //导入方法依赖的package包/类
public void succeedsWhenRequestingNativeEventsCapability() throws Throwable {
    DesiredCapabilities caps = new DesiredCapabilities("java", "1.0", Platform.getCurrent());
    caps.setCapability("nativeEvents", true);
    driver = new JavaDriver(caps, caps);
    Capabilities capabilities = ((RemoteWebDriver) driver).getCapabilities();
    AssertJUnit.assertTrue(capabilities.is("nativeEvents"));
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:8,代码来源:JavaDriverTest.java

示例6: succeedsWhenRequestingNonNativeEventsCapability

import org.openqa.selenium.Platform; //导入方法依赖的package包/类
public void succeedsWhenRequestingNonNativeEventsCapability() throws Throwable {
    DesiredCapabilities caps = new DesiredCapabilities("java", "1.0", Platform.getCurrent());
    caps.setCapability("nativeEvents", false);
    driver = new JavaDriver(caps, caps);
    Capabilities capabilities = ((RemoteWebDriver) driver).getCapabilities();
    AssertJUnit.assertTrue(!capabilities.is("nativeEvents"));
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:8,代码来源:JavaDriverTest.java

示例7: launchDriver

import org.openqa.selenium.Platform; //导入方法依赖的package包/类
public void launchDriver(String browser) throws UnCaughtException {
    RunContext context = new RunContext();
    context.BrowserName = browser;
    context.Browser = Browser.fromString(browser);
    context.Platform = Platform.getCurrent();
    context.BrowserVersion = "default";
    launchDriver(context);
}
 
开发者ID:CognizantQAHub,项目名称:Cognizant-Intelligent-Test-Scripter,代码行数:9,代码来源:SeleniumDriver.java

示例8: setupSquashWebsiteUrl

import org.openqa.selenium.Platform; //导入方法依赖的package包/类
@BeforeClass
public static void setupSquashWebsiteUrl() {
  Platform current = Platform.getCurrent();
  Assert.assertTrue("Safari can be used only on MAC and Windows platforms",
      Platform.MAC.is(current) || Platform.WINDOWS.is(current));

  Properties p = new Properties(System.getProperties());
  p.setProperty("SquashWebsiteBaseUrl",
      "http://squashwebsite.s3-website-eu-west-1.amazonaws.com/?selectedDate=2016-01-16.html");
  // This will be read before each scenario to set up the webdriver
  p.setProperty("WebDriverType", "Ipad");
  p.setProperty("WebDriverJavascriptEnabled", "true");
  System.setProperties(p);
}
 
开发者ID:robinsteel,项目名称:Sqawsh,代码行数:15,代码来源:RunIpadAcceptanceTests.java

示例9: setupSquashWebsiteUrl

import org.openqa.selenium.Platform; //导入方法依赖的package包/类
@BeforeClass
public static void setupSquashWebsiteUrl() {
  Platform current = Platform.getCurrent();
  Assert.assertTrue("Safari can be used only on MAC and Windows platforms",
      Platform.MAC.is(current) || Platform.WINDOWS.is(current));

  Properties p = new Properties(System.getProperties());
  p.setProperty("SquashWebsiteBaseUrl",
      "http://squashwebsite.s3-website-eu-west-1.amazonaws.com/?selectedDate=2016-01-11.html");
  // This will be read before each scenario to set up the webdriver
  p.setProperty("WebDriverType", "Safari");
  p.setProperty("WebDriverJavascriptEnabled", "true");
  System.setProperties(p);
}
 
开发者ID:robinsteel,项目名称:Sqawsh,代码行数:15,代码来源:RunSafariAcceptanceTests.java

示例10: setupSquashWebsiteUrl

import org.openqa.selenium.Platform; //导入方法依赖的package包/类
@BeforeClass
public static void setupSquashWebsiteUrl() {
  Platform current = Platform.getCurrent();
  Assert.assertTrue("Safari can be used only on MAC and Windows platforms",
      Platform.MAC.is(current) || Platform.WINDOWS.is(current));

  Properties p = new Properties(System.getProperties());
  p.setProperty("SquashWebsiteBaseUrl",
      "http://squashwebsite.s3-website-eu-west-1.amazonaws.com/?selectedDate=2016-01-11.html");
  // This will be read before each scenario to set up the webdriver
  p.setProperty("WebDriverType", "Firefox");
  p.setProperty("webdriver.firefox.bin", "/Applications/Firefox.app/Contents/MacOS/firefox-bin");
  p.setProperty("WebDriverJavascriptEnabled", "true");
  System.setProperties(p);
}
 
开发者ID:robinsteel,项目名称:Sqawsh,代码行数:16,代码来源:RunFirefoxAcceptanceTests.java

示例11: getExtension

import org.openqa.selenium.Platform; //导入方法依赖的package包/类
private static String getExtension() {
	Platform current = Platform.getCurrent();

	if (Platform.MAC.is(current)) {
		return "";
	} else if (Platform.LINUX.is(current)) {
		return "";
	} else {	// TODO after 2.43.1 Platform.WINDOWS was not working . quick fix
		return ".exe";
	}
}
 
开发者ID:adi4test,项目名称:WebAuto,代码行数:12,代码来源:DriverFactory.java

示例12: supportsJavascriptEnabledCapability

import org.openqa.selenium.Platform; //导入方法依赖的package包/类
public void supportsJavascriptEnabledCapability() throws Throwable {
    DesiredCapabilities caps = new DesiredCapabilities("java", "1.0", Platform.getCurrent());
    caps.setJavascriptEnabled(true);
    driver = new JavaDriver(caps, caps);
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:6,代码来源:JavaDriverTest.java

示例13: DefaultDriverSessions

import org.openqa.selenium.Platform; //导入方法依赖的package包/类
public DefaultDriverSessions() {
  this(Platform.getCurrent(), new DefaultDriverFactory());
}
 
开发者ID:alexkogon,项目名称:grid-refactor-remote-server,代码行数:4,代码来源:DefaultDriverSessions.java

示例14: isSupportedPlatform

import org.openqa.selenium.Platform; //导入方法依赖的package包/类
private Platform isSupportedPlatform() {
	return Platform.getCurrent();

}
 
开发者ID:confsoft,项目名称:FuncaoWeb,代码行数:5,代码来源:DriverSafari.java


注:本文中的org.openqa.selenium.Platform.getCurrent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。