Search in sources :

Example 11 with HtmlUnitWebElement

use of org.openqa.selenium.htmlunit.HtmlUnitWebElement in project ats-framework by Axway.

the class HiddenHtmlSingleSelectList method getAllPossibleValues.

/**
     * @return  a list with all possible selection values
     */
@Override
@PublicAtsApi
public List<String> getAllPossibleValues() {
    List<String> values = new ArrayList<String>();
    new HiddenHtmlElementState(this).waitToBecomeExisting();
    HtmlUnitWebElement selectElement = HiddenHtmlElementLocator.findElement(this);
    List<WebElement> optionElements = selectElement.findElements(By.tagName("option"));
    if (optionElements.size() > 0) {
        for (WebElement element : optionElements) {
            values.add(element.getText());
        }
        return values;
    }
    throw new SeleniumOperationException("There is no selectable 'option' in " + this.toString());
}
Also used : HiddenHtmlElementState(com.axway.ats.uiengine.utilities.hiddenbrowser.HiddenHtmlElementState) ArrayList(java.util.ArrayList) HtmlUnitWebElement(org.openqa.selenium.htmlunit.HtmlUnitWebElement) WebElement(org.openqa.selenium.WebElement) HtmlUnitWebElement(org.openqa.selenium.htmlunit.HtmlUnitWebElement) SeleniumOperationException(com.axway.ats.uiengine.exceptions.SeleniumOperationException) PublicAtsApi(com.axway.ats.common.PublicAtsApi)

Example 12 with HtmlUnitWebElement

use of org.openqa.selenium.htmlunit.HtmlUnitWebElement in project ats-framework by Axway.

the class HiddenHtmlSingleSelectList method getValue.

/**
     * @return the single selection value
     */
@Override
@PublicAtsApi
public String getValue() {
    new HiddenHtmlElementState(this).waitToBecomeExisting();
    HtmlUnitWebElement selectElement = HiddenHtmlElementLocator.findElement(this);
    List<WebElement> optionElements = selectElement.findElements(By.tagName("option"));
    for (WebElement element : optionElements) {
        if (element.isSelected()) {
            return element.getText();
        }
    }
    throw new SeleniumOperationException("There is no selected 'option' in " + this.toString());
}
Also used : HiddenHtmlElementState(com.axway.ats.uiengine.utilities.hiddenbrowser.HiddenHtmlElementState) HtmlUnitWebElement(org.openqa.selenium.htmlunit.HtmlUnitWebElement) WebElement(org.openqa.selenium.WebElement) HtmlUnitWebElement(org.openqa.selenium.htmlunit.HtmlUnitWebElement) SeleniumOperationException(com.axway.ats.uiengine.exceptions.SeleniumOperationException) PublicAtsApi(com.axway.ats.common.PublicAtsApi)

Example 13 with HtmlUnitWebElement

use of org.openqa.selenium.htmlunit.HtmlUnitWebElement in project ats-framework by Axway.

the class HiddenHtmlTextArea method appendValue.

/**
     * Append text to the current content of a Text Area
     * 
     * @param value
     */
@Override
@PublicAtsApi
public void appendValue(String value) {
    new HiddenHtmlElementState(this).waitToBecomeExisting();
    HtmlUnitWebElement element = HiddenHtmlElementLocator.findElement(this);
    element.sendKeys(value);
    UiEngineUtilities.sleep();
}
Also used : HiddenHtmlElementState(com.axway.ats.uiengine.utilities.hiddenbrowser.HiddenHtmlElementState) HtmlUnitWebElement(org.openqa.selenium.htmlunit.HtmlUnitWebElement) PublicAtsApi(com.axway.ats.common.PublicAtsApi)

Example 14 with HtmlUnitWebElement

use of org.openqa.selenium.htmlunit.HtmlUnitWebElement in project ats-framework by Axway.

the class HiddenHtmlTextBox method setValue.

/**
     * Set the Text Box value
     *
     * @param value
     */
@Override
@PublicAtsApi
public void setValue(String value) {
    new HiddenHtmlElementState(this).waitToBecomeExisting();
    HtmlUnitWebElement element = HiddenHtmlElementLocator.findElement(this);
    element.clear();
    element.sendKeys(value);
    UiEngineUtilities.sleep();
}
Also used : HiddenHtmlElementState(com.axway.ats.uiengine.utilities.hiddenbrowser.HiddenHtmlElementState) HtmlUnitWebElement(org.openqa.selenium.htmlunit.HtmlUnitWebElement) PublicAtsApi(com.axway.ats.common.PublicAtsApi)

Aggregations

HtmlUnitWebElement (org.openqa.selenium.htmlunit.HtmlUnitWebElement)14 PublicAtsApi (com.axway.ats.common.PublicAtsApi)13 HiddenHtmlElementState (com.axway.ats.uiengine.utilities.hiddenbrowser.HiddenHtmlElementState)12 WebElement (org.openqa.selenium.WebElement)7 SeleniumOperationException (com.axway.ats.uiengine.exceptions.SeleniumOperationException)6 ArrayList (java.util.ArrayList)2 HiddenBrowserDriver (com.axway.ats.uiengine.HiddenBrowserDriver)1 ElementNotFoundException (com.axway.ats.uiengine.exceptions.ElementNotFoundException)1 WebDriver (org.openqa.selenium.WebDriver)1