use of com.axway.ats.uiengine.utilities.hiddenbrowser.HiddenHtmlElementState in project ats-framework by Axway.
the class HiddenHtmlMultiSelectList method getValues.
/**
* @return the selected value
*/
@Override
@PublicAtsApi
public String[] getValues() {
new HiddenHtmlElementState(this).waitToBecomeExisting();
HtmlUnitWebElement selectElement = HiddenHtmlElementLocator.findElement(this);
List<String> values = new ArrayList<String>();
List<WebElement> optionElements = selectElement.findElements(By.tagName("option"));
for (WebElement element : optionElements) {
if (element.isSelected()) {
values.add(element.getText());
}
}
if (values.isEmpty()) {
throw new SeleniumOperationException("There is no selected 'option' in " + this.toString());
}
return values.toArray(new String[0]);
}
use of com.axway.ats.uiengine.utilities.hiddenbrowser.HiddenHtmlElementState in project ats-framework by Axway.
the class HiddenHtmlMultiSelectList method unsetValue.
/**
* unselect a value
*
* @param value the value to unselect
*/
@Override
@PublicAtsApi
public void unsetValue(String value) {
new HiddenHtmlElementState(this).waitToBecomeExisting();
HtmlUnitWebElement selectElement = HiddenHtmlElementLocator.findElement(this);
List<WebElement> optionElements = selectElement.findElements(By.tagName("option"));
for (WebElement el : optionElements) {
if (el.getText().equals(value)) {
if (el.isSelected()) {
((HtmlUnitWebElement) el).click();
UiEngineUtilities.sleep();
}
return;
}
}
throw new SeleniumOperationException("Option with label '" + value + "' not found. (" + this.toString() + ")");
}
use of com.axway.ats.uiengine.utilities.hiddenbrowser.HiddenHtmlElementState in project ats-framework by Axway.
the class HiddenHtmlLink method click.
/**
* Click the link
*/
@PublicAtsApi
public void click() {
new HiddenHtmlElementState(this).waitToBecomeExisting();
HiddenHtmlElementUtils.mouseClick(HiddenHtmlElementLocator.findElement(this));
UiEngineUtilities.sleep();
}
use of com.axway.ats.uiengine.utilities.hiddenbrowser.HiddenHtmlElementState in project ats-framework by Axway.
the class HiddenHtmlLink method clickAndDownloadFile.
/**
* Click link and download file
*/
@PublicAtsApi
public void clickAndDownloadFile() {
new HiddenHtmlElementState(this).waitToBecomeExisting();
new HiddenHtmlElement(uiDriver, new UiElementProperties().addProperty("xpath", properties.getInternalProperty(HtmlElementLocatorBuilder.PROPERTY_ELEMENT_LOCATOR))).clickAndDownloadFile();
UiEngineUtilities.sleep();
}
use of com.axway.ats.uiengine.utilities.hiddenbrowser.HiddenHtmlElementState in project ats-framework by Axway.
the class HiddenHtmlButton method click.
@Override
@PublicAtsApi
public void click() {
new HiddenHtmlElementState(this).waitToBecomeExisting();
HiddenHtmlElementUtils.mouseClick(HiddenHtmlElementLocator.findElement(this));
UiEngineUtilities.sleep();
}
Aggregations