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

cz.datalite.webdriver.components.Datebox Maven / Gradle / Ivy

Go to download

Integration tests with Selenium 2.0 (WebDriver) - PageObjects pattern (still in beta)

The newest version!
package cz.datalite.webdriver.components;

import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;

import java.util.Calendar;

/**
 * Mirror of Datebox
 *
 * @author Karel Cemus
 */
public class Datebox extends InputElement {

    public Datebox( final ZkElement parent, final WebElement webElement ) {
        super( parent, webElement );
    }

    @Override
    public void autoFill() {
        write( "1.1." + Calendar.getInstance().get( Calendar.YEAR ) );
    }

    @Override
    public void write( final String value ) {
        clear();
        webElement.findElement( By.tagName( "input" ) ).sendKeys( value );
    }

    @Override
    public void clear() {
        webElement.findElement( By.tagName( "input" ) ).clear();
    }

    @Override
    public String getValue() {
        return webElement.findElement( By.tagName( "input" ) ).getAttribute("value");
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy