use of com.axway.ats.uiengine.utilities.hiddenbrowser.HiddenHtmlElementState in project ats-framework by Axway.
the class HiddenHtmlCheckBox method unCheck.
/**
* Uncheck the check box
*/
@Override
@PublicAtsApi
public void unCheck() {
new HiddenHtmlElementState(this).waitToBecomeExisting();
HtmlUnitWebElement element = HiddenHtmlElementLocator.findElement(this);
if (!element.isEnabled()) {
throw new UnsupportedOperationException("You may not uncheck a disabled element." + toString());
}
if (element.isSelected()) {
element.click();
}
UiEngineUtilities.sleep();
}
use of com.axway.ats.uiengine.utilities.hiddenbrowser.HiddenHtmlElementState in project ats-framework by Axway.
the class HiddenHtmlElement method pressEnterKey.
/**
* Simulate Enter key
*/
@Override
@PublicAtsApi
public void pressEnterKey() {
new HiddenHtmlElementState(this).waitToBecomeExisting();
WebElement element = HiddenHtmlElementLocator.findElement(this);
new Actions(htmlUnitDriver).sendKeys(element, "\r").perform();
// new Actions( htmlUnitDriver ).sendKeys( element, Keys.RETURN ).perform();
}
use of com.axway.ats.uiengine.utilities.hiddenbrowser.HiddenHtmlElementState in project ats-framework by Axway.
the class HiddenHtmlElement method doubleClick.
/**
* Simulate mouse double click action
*/
@Override
@PublicAtsApi
public void doubleClick() {
new HiddenHtmlElementState(this).waitToBecomeExisting();
WebElement element = HiddenHtmlElementLocator.findElement(this);
new Actions(htmlUnitDriver).doubleClick(element).perform();
}
use of com.axway.ats.uiengine.utilities.hiddenbrowser.HiddenHtmlElementState 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 com.axway.ats.uiengine.utilities.hiddenbrowser.HiddenHtmlElementState 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());
}
Aggregations