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());
}
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());
}
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();
}
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();
}
Aggregations