org.openqa.selenium.Platform Java Examples

The following examples show how to use org.openqa.selenium.Platform. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: FirefoxOptionsTest.java    From selenium with Apache License 2.0 6 votes vote down vote up
@Test
public void shouldPickUpBinaryFromSystemPropertyIfSet() throws IOException {
  JreSystemProperty property = new JreSystemProperty(BROWSER_BINARY);

  Path binary = Files.createTempFile("firefox", ".exe");
  try (OutputStream ignored = Files.newOutputStream(binary, DELETE_ON_CLOSE)) {
    Files.write(binary, "".getBytes());
    if (! TestUtilities.getEffectivePlatform().is(Platform.WINDOWS)) {
      Files.setPosixFilePermissions(binary, singleton(PosixFilePermission.OWNER_EXECUTE));
    }
    property.set(binary.toString());
    FirefoxOptions options = new FirefoxOptions();

    FirefoxBinary firefoxBinary =
        options.getBinaryOrNull().orElseThrow(() -> new AssertionError("No binary"));

    assertThat(firefoxBinary.getPath()).isEqualTo(binary.toString());
  } finally {
    property.reset();
  }
}
 
Example #2
Source File: BrowserStatementTest.java    From neodymium-library with MIT License 6 votes vote down vote up
private void checkTestEnvironment(BrowserConfiguration config)
{
    Assert.assertNotNull(config);
    Assert.assertEquals("testEnvironmentFlags", config.getConfigTag());
    Assert.assertEquals("Test Environment Browser", config.getName());
    MutableCapabilities testCapabilities = config.getCapabilities();
    Assert.assertEquals("chrome", testCapabilities.getBrowserName());
    Assert.assertEquals(1234, testCapabilities.getCapability("idleTimeout"));
    Assert.assertEquals(1234, testCapabilities.getCapability("idletimeout"));
    Assert.assertEquals(5678, testCapabilities.getCapability("maxDuration"));
    Assert.assertEquals(5678, testCapabilities.getCapability("maxduration"));
    Assert.assertEquals("3.1234", testCapabilities.getCapability("seleniumVersion"));
    Assert.assertEquals("3.1234", testCapabilities.getCapability("selenium-version"));
    Assert.assertEquals("800x600", testCapabilities.getCapability("screenResolution"));
    Assert.assertEquals("800x600", testCapabilities.getCapability("screen-resolution"));
    Assert.assertEquals(Platform.VISTA, testCapabilities.getCapability("platform"));
    Assert.assertEquals("Windows 10", testCapabilities.getCapability("platformName"));
    Assert.assertEquals("MyDevice", testCapabilities.getCapability("deviceName"));
    Assert.assertEquals("portrait", testCapabilities.getCapability("deviceOrientation"));
    Assert.assertEquals("landscape", testCapabilities.getCapability("orientation"));
}
 
Example #3
Source File: WebDriverManager.java    From vividus with Apache License 2.0 6 votes vote down vote up
private static boolean isPlatformName(Capabilities capabilities, String platformName)
{
    return checkCapabilities(capabilities, () ->
    {
        Object platformNameFromCaps = capabilities.getCapability(CapabilityType.PLATFORM_NAME);
        if (platformNameFromCaps instanceof String)
        {
            return platformNameFromCaps.equals(platformName);
        }
        if (platformNameFromCaps instanceof Platform)
        {
            return platformNameFromCaps == Platform.fromString(platformName);
        }
        return false;
    });
}
 
Example #4
Source File: TestSuite.java    From packagedrone with Eclipse Public License 1.0 6 votes vote down vote up
protected static RemoteWebDriver createSauce ( final Platform os, final String browser, final String version ) throws MalformedURLException
{
    final DesiredCapabilities capabilities = new DesiredCapabilities ();
    capabilities.setBrowserName ( browser );
    if ( version != null )
    {
        capabilities.setVersion ( version );
    }
    capabilities.setCapability ( CapabilityType.PLATFORM, os );
    capabilities.setCapability ( CapabilityType.SUPPORTS_FINDING_BY_CSS, true );
    capabilities.setCapability ( "name", "Eclipse Package Drone Main Test" );

    if ( System.getenv ( "TRAVIS_JOB_NUMBER" ) != null )
    {
        capabilities.setCapability ( "tunnel-identifier", System.getenv ( "TRAVIS_JOB_NUMBER" ) );
        capabilities.setCapability ( "build", System.getenv ( "TRAVIS_BUILD_NUMBER" ) );
        capabilities.setCapability ( "tags", new String[] { "CI" } );
    }

    final RemoteWebDriver driver = new RemoteWebDriver ( new URL ( String.format ( "http://%s:%s@%s/wd/hub", SAUCE_USER_NAME, SAUCE_ACCESS_KEY, SAUCE_URL ) ), capabilities );

    driver.setFileDetector ( new LocalFileDetector () );

    return driver;
}
 
Example #5
Source File: TestingBotPaasHandler.java    From KITE with Apache License 2.0 6 votes vote down vote up
@Override
public void fetchConfig() throws IOException {
  
  List<JsonObject> availableConfigList = this.getAvailableConfigList(null, null);
  
  /* might be not necessary, depending on data format it DB */
  for (JsonObject jsonObject : availableConfigList) {
    Client client = new Client();
    client.getBrowserSpecs().setVersion(jsonObject.getString("version", ""));
    
    String browserName = jsonObject.getString("name", "");
    if (browserName.endsWith("edge"))
      browserName = BrowserType.EDGE;
    else if (browserName.equalsIgnoreCase(BrowserType.GOOGLECHROME))
      browserName = BrowserType.CHROME;
    client.getBrowserSpecs().setBrowserName(browserName);
    
    String platform = jsonObject.getString("platform", "");
    client.getBrowserSpecs().setPlatform(
      platform.equalsIgnoreCase("CAPITAN") ? Platform.EL_CAPITAN : Platform.fromString(platform));
    
    this.clientList.add(client);
  }
  
}
 
Example #6
Source File: FileNameFormatterTest.java    From hifive-pitalium with Apache License 2.0 6 votes vote down vote up
/**
 * 通常のフォーマットテスト(セレクタ)
 */
@Test
public void testFormat_selector() throws Exception {
	PtlCapabilities capabilities = new PtlCapabilities(new HashMap<String, Object>());
	capabilities.setPlatform(Platform.WINDOWS);
	capabilities.setBrowserName("firefox");
	capabilities.setVersion("38");

	PersistMetadata metadata = new PersistMetadata("testId", "testClass", "testMethod", "scId",
			new IndexDomSelector(SelectorType.TAG_NAME, "body", 1), null, capabilities);

	FileNameFormatter formatter = new FileNameFormatter(
			"{platformName}_{platformVersion}_{browserName}_{version}_{screenArea}.png");
	String result = formatter.format(metadata);
	assertThat(result, is("testMethod_scId_WINDOWS_firefox_38_TAG_NAME_body_[1].png"));
}
 
Example #7
Source File: CapabilitiesComparatorTest.java    From selenium with Apache License 2.0 6 votes vote down vote up
@Test
public void shouldPickCorrectBrowser() {
  Capabilities chrome = new DesiredCapabilities(BrowserType.CHROME, "10", Platform.ANY);
  Capabilities firefox = new DesiredCapabilities(BrowserType.FIREFOX, "10", Platform.ANY);
  Capabilities opera = new DesiredCapabilities(BrowserType.OPERA_BLINK, "10", Platform.ANY);
  List<Capabilities> list = asList(chrome, firefox, opera);

  DesiredCapabilities desired = new DesiredCapabilities();

  desired.setBrowserName(BrowserType.CHROME);
  assertThat(getBestMatch(desired, list)).isEqualTo(chrome);

  desired.setBrowserName(BrowserType.FIREFOX);
  assertThat(getBestMatch(desired, list)).isEqualTo(firefox);

  desired.setBrowserName(BrowserType.OPERA_BLINK);
  assertThat(getBestMatch(desired, list)).isEqualTo(opera);
}
 
Example #8
Source File: AssumeCapability.java    From hifive-pitalium with Apache License 2.0 6 votes vote down vote up
/**
 * {@link Platform#family()}から辿れるPlatformの親一覧を取得します。
 * 
 * @param platform 対象のPlatform
 * @return 引数のPlatformと、引数のPlatformの親Platform一覧
 */
private static Collection<Platform> toPlatformFamily(Platform platform) {
	Set<Platform> platforms = EnumSet.noneOf(Platform.class);
	if (platform == null) {
		return platforms;
	}

	platforms.add(platform);

	Platform parent = platform.family();
	while (parent != null && parent != Platform.ANY) {
		platforms.add(parent);
		parent = parent.family();
	}
	return platforms;
}
 
Example #9
Source File: JsonOutputTest.java    From selenium with Apache License 2.0 6 votes vote down vote up
@Test
public void shouldConvertAProxyCorrectly() {
  Proxy proxy = new Proxy();
  proxy.setHttpProxy("localhost:4444");

  MutableCapabilities caps = new DesiredCapabilities("foo", "1", Platform.LINUX);
  caps.setCapability(CapabilityType.PROXY, proxy);
  Map<String, ?> asMap = ImmutableMap.of("desiredCapabilities", caps);
  Command command = new Command(new SessionId("empty"), DriverCommand.NEW_SESSION, asMap);

  String json = convert(command.getParameters());

  JsonObject converted = new JsonParser().parse(json).getAsJsonObject();
  JsonObject capsAsMap = converted.get("desiredCapabilities").getAsJsonObject();

  assertThat(capsAsMap.get(CapabilityType.PROXY).getAsJsonObject().get("httpProxy").getAsString())
      .isEqualTo(proxy.getHttpProxy());
}
 
Example #10
Source File: CapabilitiesComparatorTest.java    From selenium with Apache License 2.0 6 votes vote down vote up
@Test
public void currentPlatformCheckDoesNotTrumpExactPlatformMatch() {
  Capabilities chromeUnix = capabilities(BrowserType.CHROME, "", Platform.UNIX, true);
  Capabilities chromeVista = capabilities(BrowserType.CHROME, "", Platform.VISTA, true);
  Capabilities anyChrome = new DesiredCapabilities(BrowserType.CHROME, "10", Platform.ANY);

  List<Capabilities> allCaps = asList(anyChrome, chromeVista, chromeUnix);

  assertThat(getBestMatch(chromeVista, allCaps, Platform.UNIX)).isEqualTo(chromeVista);
  assertThat(getBestMatch(chromeVista, allCaps, Platform.LINUX)).isEqualTo(chromeVista);
  assertThat(getBestMatch(chromeVista, allCaps, Platform.MAC)).isEqualTo(chromeVista);

  assertThat(getBestMatch(chromeUnix, allCaps, Platform.MAC)).isEqualTo(chromeUnix);
  assertThat(getBestMatch(chromeUnix, allCaps, Platform.VISTA)).isEqualTo(chromeUnix);
  assertThat(getBestMatch(chromeUnix, allCaps, Platform.WINDOWS)).isEqualTo(chromeUnix);
}
 
Example #11
Source File: JavaDriverTest.java    From marathonv5 with Apache License 2.0 6 votes vote down vote up
public void failsWhenRequestingNonCurrentPlatform() throws Throwable {
    Platform[] values = Platform.values();
    Platform otherPlatform = null;
    for (Platform platform : values) {
        if (Platform.getCurrent().is(platform)) {
            continue;
        }
        otherPlatform = platform;
        break;
    }
    DesiredCapabilities caps = new DesiredCapabilities("java", "1.0", otherPlatform);
    try {
        driver = new JavaDriver(caps, caps);
        throw new MissingException(SessionNotCreatedException.class);
    } catch (SessionNotCreatedException e) {
    }
}
 
Example #12
Source File: HttpClientTestBase.java    From selenium with Apache License 2.0 6 votes vote down vote up
@Test
public void shouldIncludeAUserAgentHeader() throws Exception {
  HttpResponse response = executeWithinServer(
      new HttpRequest(GET, "/foo"),
      new HttpServlet() {
        @Override
        protected void doGet(HttpServletRequest req, HttpServletResponse resp)
            throws IOException {
          try (Writer writer = resp.getWriter()) {
            writer.write(req.getHeader("user-agent"));
          }
        }
      });


  String label = new BuildInfo().getReleaseLabel();
  Platform platform = Platform.getCurrent();
  Platform family = platform.family() == null ? platform : platform.family();

  assertThat(string(response)).isEqualTo(String.format(
      "selenium/%s (java %s)",
      label,
      family.toString().toLowerCase()));
}
 
Example #13
Source File: TestEnvironmentTest.java    From senbot with MIT License 6 votes vote down vote up
@Test
public void testCleanupDriver() throws Throwable {
	final WebDriver webDriver = mock(WebDriver.class);
	TestEnvironment env = new TestEnvironment(null, null, Platform.WINDOWS){
		@Override
		public WebDriver getWebDriver(){
			return webDriver;
		}
	};
	
	assertEquals(webDriver, env.getWebDriver());
	
	env.cleanupDriver();
	
	verify(webDriver, times(1)).quit();
	env.cleanupAllDrivers();
}
 
Example #14
Source File: FileNameFormatterTest.java    From hifive-pitalium with Apache License 2.0 6 votes vote down vote up
/**
 * 通常のフォーマットテスト(矩形)
 */
@Test
public void testFormat_rectangle() throws Exception {
	PtlCapabilities capabilities = new PtlCapabilities(new HashMap<String, Object>());
	capabilities.setPlatform(Platform.WINDOWS);
	capabilities.setBrowserName("firefox");
	capabilities.setVersion("38");

	PersistMetadata metadata = new PersistMetadata("testId", "testClass", "testMethod", "scId", null,
			new RectangleArea(0, 10, 100, 1000), capabilities);

	FileNameFormatter formatter = new FileNameFormatter(
			"{platformName}_{platformVersion}_{browserName}_{version}_{screenArea}.png");
	String result = formatter.format(metadata);
	assertThat(result, is("testMethod_scId_WINDOWS_firefox_38_rect_0_10_100_1000.png"));
}
 
Example #15
Source File: IECaps.java    From teasy with MIT License 6 votes vote down vote up
private InternetExplorerOptions getIEOptions() {
    InternetExplorerOptions caps = new InternetExplorerOptions();
    caps.setCapability("version", this.version);
    caps.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true);
    caps.setCapability(InternetExplorerDriver.IE_SWITCHES, "-private");
    caps.setCapability(InternetExplorerDriver.FORCE_CREATE_PROCESS, true);
    caps.setCapability(InternetExplorerDriver.IE_ENSURE_CLEAN_SESSION, true);
    caps.setCapability(CapabilityType.SUPPORTS_ALERTS, true);
    caps.setCapability("platform", Platform.WINDOWS);
    caps.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);
    caps.setCapability(CapabilityType.UNEXPECTED_ALERT_BEHAVIOUR, this.alertBehaviour);

    //Found that setting this capability could increase IE tests speed. Should be checked.
    caps.setCapability(InternetExplorerDriver.REQUIRE_WINDOW_FOCUS, true);
    setLoggingPrefs(caps);
    return caps;
}
 
Example #16
Source File: LaunchJavaCommandLineTest.java    From marathonv5 with Apache License 2.0 5 votes vote down vote up
@BeforeMethod
public void createDriver() {
    System.setProperty(Constants.PROP_PROJECT_FRAMEWORK, Constants.FRAMEWORK_SWING);
    JavaProfile profile = new JavaProfile(LaunchMode.JAVA_COMMAND_LINE);
    File f = findFile();
    profile.addClassPath(f);
    profile.setRecordingPort(startRecordingServer());
    profile.setMainClass("com.sun.swingset3.SwingSet3");
    DesiredCapabilities caps = new DesiredCapabilities("java", "1.5", Platform.ANY);
    driver = new JavaDriver(profile, caps, caps);
}
 
Example #17
Source File: LaunchCommandLineTest.java    From marathonv5 with Apache License 2.0 5 votes vote down vote up
@BeforeClass
public void createDriver() {
    JavaProfile profile = new JavaProfile(LaunchMode.COMMAND_LINE);
    File f = findFile();
    profile.setCommand(f.getAbsolutePath());
    profile.addApplicationArguments("Argument1");
    DesiredCapabilities caps = new DesiredCapabilities("java", "1.5", Platform.ANY);
    driver = new JavaDriver(profile, caps, caps);
}
 
Example #18
Source File: Build.java    From selenium with Apache License 2.0 5 votes vote down vote up
private ProcessBuilder prepareBuild() {
  List<String> command = new ArrayList<>();
  if (Platform.getCurrent().is(WINDOWS)) {
    command.add("cmd.exe");
    command.add("/c");
    command.add("go.bat");
  } else {
    command.add("./go");
  }
  command.addAll(targets);
  ProcessBuilder builder = new ProcessBuilder(command);
  builder.directory(InProject.locate("Rakefile").getParent().toFile());
  builder.redirectErrorStream(true);
  return builder;
}
 
Example #19
Source File: CapabilitiesComparatorTest.java    From selenium with Apache License 2.0 5 votes vote down vote up
@Test
public void shouldMatchByPlatform_assumingAllOtherPropertiesAreTheSame() {
  comparator = compareBy(capabilities(BrowserType.FIREFOX, "6", Platform.ANY, true));

  Capabilities c1 = capabilities(BrowserType.FIREFOX, "6", Platform.ANY, true);
  Capabilities c2 = capabilities(BrowserType.FIREFOX, "6", Platform.LINUX, true);

  assertGreaterThan(c1, c2);
}
 
Example #20
Source File: SingleScrollElementTest.java    From hifive-pitalium with Apache License 2.0 5 votes vote down vote up
/**
 * 要素内スクロールがあるTABLE要素を要素内スクロールオプションあり、移動オプションありを設定して撮影する。
 *
 * @ptl.expect スクリーンショット撮影結果が正しいこと。
 */
@Test
public void takeTableScreenshot_scroll_move() throws Exception {
	assumeFalse("Skip IE8 table test.", isInternetExplorer8());
	assumeFalse("Skip IE9 table test.", isInternetExplorer9());

	openScrollPage();

	ScreenshotArgument arg = ScreenshotArgument.builder("s").addNewTargetByCssSelector("#table-scroll > tbody")
			.scrollTarget(true).moveTarget(true).build();
	assertionView.assertView(arg);

	// Check
	double ratio = getPixelRatio();
	Rect rect = getPixelRectById("table-scroll");
	BufferedImage image = loadTargetResults("s").get(0).getImage().get();
	assertThat(image.getHeight(), is(greaterThan((int) rect.height)));

	int x = image.getWidth() / 2;
	int y = 0;
	int cellCount = 0;
	float cellHeight = 20;
	if (BrowserType.FIREFOX.equals(capabilities.getBrowserName())
			&& Platform.MAC.equals(capabilities.getPlatform())) {
		cellHeight = 20.45f;
	}
	while (cellCount <= 15) {
		Color expect = Color.valueOf(image.getRGB(0, (int) Math.round(cellCount * cellHeight * ratio)));
		cellCount++;
		int maxY = (int) Math.round(cellCount * cellHeight * ratio);
		while (y < maxY) {
			Color actual = Color.valueOf(image.getRGB(x, y));
			assertThat(String.format("Point (%d, %d) is not match.", x, y), actual, is(expect));
			y++;
		}
	}
}
 
Example #21
Source File: IEWebDriverProxyTest.java    From marathonv5 with Apache License 2.0 5 votes vote down vote up
@Override
protected void checkPlatform() {

    if (!Platform.getCurrent().is(Platform.WINDOWS)) {
        throw new SkipException("IE Driver supported only on windows");
    }
}
 
Example #22
Source File: CapabilitiesComparatorTest.java    From selenium with Apache License 2.0 5 votes vote down vote up
@Test
public void pickingWindowsFromVariousLists() {
  Capabilities any = capabilities(BrowserType.IE, "", Platform.ANY, true);
  Capabilities windows = capabilities(BrowserType.IE, "", Platform.WINDOWS, true);
  Capabilities xp = capabilities(BrowserType.IE, "", Platform.XP, true);
  Capabilities vista = capabilities(BrowserType.IE, "", Platform.VISTA, true);

  assertThat(getBestMatch(windows, singletonList(any))).isEqualTo(any);
  assertThat(getBestMatch(windows, asList(any, windows))).isEqualTo(windows);
  assertThat(getBestMatch(windows, asList(windows, xp, vista))).isEqualTo(windows);
  assertThat(getBestMatch(windows, asList(xp, vista))).isIn(xp, vista);
  assertThat(getBestMatch(windows, singletonList(xp))).isEqualTo(xp);
  assertThat(getBestMatch(windows, singletonList(vista))).isEqualTo(vista);
}
 
Example #23
Source File: RunManager.java    From Cognizant-Intelligent-Test-Scripter with Apache License 2.0 5 votes vote down vote up
static Queue<RunContext> getTestCaseRunManager() {
    Queue<RunContext> execQ = new LinkedList<>();
    RunContext exe = new RunContext();
    exe.Scenario = globalSettings.getScenario();
    exe.TestCase = globalSettings.getTestCase();
    exe.Description = "Test Run";
    exe.BrowserName = globalSettings.getBrowser();
    exe.Browser = Browser.fromString(exe.BrowserName);
    exe.Platform = Platform.ANY;
    exe.BrowserVersion = "default";
    exe.Iteration = "Single";
    exe.print();
    execQ.add(exe);
    return execQ;
}
 
Example #24
Source File: AssumeCapabilityTest.java    From hifive-pitalium with Apache License 2.0 5 votes vote down vote up
@Parameterized.Parameters(name = "{0}")
public static Iterable<Object[]> parameters() {
	return parameters(capabilities(BrowserType.IE, "11.0", Platform.VISTA, null, "pc"),
			capabilities(BrowserType.IE, "10.0", Platform.VISTA, null, "pc"),
			capabilities(BrowserType.EDGE, null, Platform.WIN10, null, "pc"),
			capabilities(BrowserType.FIREFOX, "45.0", Platform.VISTA, null, "pc"),
			capabilities(BrowserType.CHROME, "49.0", Platform.VISTA, null, "pc"),
			capabilities(BrowserType.SAFARI, "9.1", Platform.EL_CAPITAN, null, "pc"),
			capabilities(BrowserType.CHROME, "49.0", Platform.ANDROID, "Nexus 6P", "mobile"),
			capabilities(BrowserType.SAFARI, "9.1", null, "iPhone6S", "mobile"),
			capabilities(BrowserType.SAFARI, "9.1", null, "iPad Air", "mobile"));
}
 
Example #25
Source File: DockerOptions.java    From selenium with Apache License 2.0 5 votes vote down vote up
private URI getDockerUri() {
  try {
    Optional<String> possibleUri = config.get(DOCKER_SECTION, "url");
    if (possibleUri.isPresent()) {
      return new URI(possibleUri.get());
    }

    Optional<String> possibleHost = config.get(DOCKER_SECTION, "host");
    if (possibleHost.isPresent()) {
      String host = possibleHost.get();
      if (!(host.startsWith("tcp:") || host.startsWith("http:") || host.startsWith("https"))) {
        host = "http://" + host;
      }
      URI uri = new URI(host);
      return new URI(
        "http",
        uri.getUserInfo(),
        uri.getHost(),
        uri.getPort(),
        uri.getPath(),
        null,
        null);
    }

    // Default for the system we're running on.
    if (Platform.getCurrent().is(WINDOWS)) {
      return new URI("http://localhost:2376");
    }
    return new URI("unix:/var/run/docker.sock");
  } catch (URISyntaxException e) {
    throw new ConfigException("Unable to determine docker url", e);
  }
}
 
Example #26
Source File: AbstractTest.java    From selenium-grid-extensions with Apache License 2.0 5 votes vote down vote up
private DesiredCapabilities firefoxWithSikuli() {
    DesiredCapabilities desiredCapabilities = new DesiredCapabilities();
    desiredCapabilities.setBrowserName("firefox");
    desiredCapabilities.setPlatform(Platform.ANY);
    desiredCapabilities.setCapability("sikuliExtension", true);
    return desiredCapabilities;
}
 
Example #27
Source File: DriverFactoryTest.java    From selenium with Apache License 2.0 5 votes vote down vote up
@Test
public void testShouldReturnDriverWhereTheMostCapabilitiesMatch_lotsOfRegisteredDrivers() {
  DesiredCapabilities desiredCapabilities = new DesiredCapabilities();
  desiredCapabilities.setBrowserName(FIREFOX);
  desiredCapabilities.setVersion("");
  desiredCapabilities.setJavascriptEnabled(true);
  desiredCapabilities.setPlatform(Platform.ANY);

  assertEquals(FIREFOX, factory.getProviderMatching(desiredCapabilities)
      .getProvidedCapabilities().getBrowserName());
}
 
Example #28
Source File: SauceLabsWebDriverHelper.java    From rice with Educational Community License v2.0 5 votes vote down vote up
private String deriveResourceBaseNames(String className, String testName, String resource) {
    return className + "." + testName + "-"
            + System.getProperty(SAUCE_PLATFORM_PROPERTY, Platform.UNIX.toString()) + "-"
            + System.getProperty(SAUCE_BROWSER_PROPERTY) + "-"
            + System.getProperty(SAUCE_VERSION_PROPERTY) + "-"
            + System.getProperty(WebDriverUtils.REMOTE_PUBLIC_USER_PROPERTY, "admin") + "-"
            + System.getProperty(SAUCE_BUILD_PROPERTY, "unknown_build") + "-"
            + AutomatedFunctionalTestUtils.DTS + "-"
            + resource;
}
 
Example #29
Source File: ConfigurableCapabilityMatcherTest.java    From selenium-api with MIT License 5 votes vote down vote up
@BeforeClass
public void createMatcher() {
    sut = new ConfigurableCapabilityMatcher();
    windowsNode.put(CapabilityType.PLATFORM, Platform.VISTA);
    windowsNode.put(CapabilityType.BROWSER_NAME, "firefox");
    windowsNode.put(CapabilityType.VERSION, "32.0");
}
 
Example #30
Source File: AdfTable.java    From adf-selenium with Apache License 2.0 5 votes vote down vote up
public void selectAdditionalRow(int index) {
    scrollToRowIndex(index);
    WebElement row = findRow(index);
    final Keys key = isPlatform(Platform.MAC) ? Keys.COMMAND : Keys.CONTROL;
    new Actions(getDriver()).keyDown(key).click(row).keyUp(key).perform();
    waitForPpr();
}