Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
- import java.util.List;
- import org.openqa.selenium.*;
- import org.openqa.selenium.support.FindBy;
- /**
- *
- * @author janipav
- */
- public class WebButton implements WebElement{
- private WebElement theButton;
- private List<WebElement> elements;
- private WebDriver driver;
- public WebButton(WebDriver driver){
- this.driver = driver;
- }
- public void click() {
- theButton.click();
- }
- public void submit() {
- theButton.submit();
- }
- public void sendKeys(CharSequence... keysToSend) {
- theButton.sendKeys(keysToSend);
- }
- public void clear() {
- theButton.clear();
- }
- public String getTagName() {
- return theButton.getTagName();
- }
- public String getAttribute(String name) {
- return theButton.getAttribute(name);
- }
- public boolean isSelected() {
- return theButton.isSelected();
- }
- public boolean isEnabled() {
- return theButton.isEnabled();
- }
- public String getText() {
- return theButton.getText();
- }
- public List<WebElement> findElements(By by) {
- elements = driver.findElements(by);
- return elements;
- }
- public WebElement findElement(By by) {
- theButton = driver.findElement(by);
- return theButton;
- }
- public boolean isDisplayed() {
- return theButton.isDisplayed();
- }
- public Point getLocation() {
- return theButton.getLocation();
- }
- public Dimension getSize() {
- return theButton.getSize();
- }
- public String getCssValue(String propertyName) {
- return theButton.getCssValue(propertyName);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement