All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.testvagrant.ekam.atoms.web.WebPage Maven / Gradle / Ivy

There is a newer version: 1.0.4
Show newest version
package com.testvagrant.ekam.atoms.web;

import com.google.inject.Inject;
import com.testvagrant.ekam.atoms.MultiPlatformFinder;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;

public class WebPage extends QueryFunctions {

  @Inject protected BrowserDriver browserDriver;
  @Inject protected WebDriver driver;

  protected Element element(By locator) {
    return new Element(driver, locator);
  }

  protected Element element(MultiPlatformFinder finder) {
    return new Element(driver, finder);
  }

  protected Textbox textbox(By locator) {
    return new Textbox(driver, locator);
  }

  protected Textbox textbox(MultiPlatformFinder finder) {
    return new Textbox(driver, finder);
  }

  protected Dropdown dropdown(By locator) {
    return new Dropdown(driver, locator);
  }

  protected MultiPlatformFinder finder(By findBy, By responsiveFindBy) {
    return MultiPlatformFinder.builder()
        .webFindBy(findBy)
        .responsiveFindBy(responsiveFindBy)
        .build();
  }

  protected ElementCollection elementCollection(By locator) {
    return new ElementCollection(driver, locator);
  }

  @Override
  public String toString() {
    return "{"
            + "\"browserDriver\":" + browserDriver
            + ", \"driver\":" + driver
            + "}";
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy