use of com.axway.ats.uiengine.utilities.hiddenbrowser.HiddenHtmlElementState in project ats-framework by Axway.
the class HiddenHtmlTextArea method setValue.
/**
* Set the Text Area 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();
}
use of com.axway.ats.uiengine.utilities.hiddenbrowser.HiddenHtmlElementState in project ats-framework by Axway.
the class HiddenHtmlTextBox method appendValue.
/**
* Append text to the current content of a Text Box
*
* @param value
*/
@PublicAtsApi
public void appendValue(String value) {
new HiddenHtmlElementState(this).waitToBecomeExisting();
HtmlUnitWebElement element = HiddenHtmlElementLocator.findElement(this);
element.sendKeys(value);
UiEngineUtilities.sleep();
}
use of com.axway.ats.uiengine.utilities.hiddenbrowser.HiddenHtmlElementState in project ats-framework by Axway.
the class HiddenHtmlMultiSelectList method setValue.
/**
* select a value
*
* @param value the value to select
*/
@Override
@PublicAtsApi
public void setValue(String value) {
new HiddenHtmlElementState(this).waitToBecomeExisting();
HtmlUnitWebElement selectElement = HiddenHtmlElementLocator.findElement(this);
if (selectElement.getAttribute("multiple") == null) {
throw new SeleniumOperationException("Not a multi-select. You may only add a selection to a select that supports multiple selections. (" + this.toString() + ")");
}
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 HiddenHtmlElement method dragAndDropTo.
/**
* Drag and drop an element on top of other element
* @param targetElement the target element
*/
@Override
@PublicAtsApi
public void dragAndDropTo(HtmlElement targetElement) {
new HiddenHtmlElementState(this).waitToBecomeExisting();
WebElement source = HiddenHtmlElementLocator.findElement(this);
WebElement target = HiddenHtmlElementLocator.findElement(targetElement);
Actions actionBuilder = new Actions(htmlUnitDriver);
Action dragAndDropAction = actionBuilder.clickAndHold(source).moveToElement(target, 1, 1).release(target).build();
dragAndDropAction.perform();
// drops the source element in the middle of the target, which in some cases is not doing drop on the right place
// new Actions( htmlUnitDriver ).dragAndDrop( source, target ).perform();
}
use of com.axway.ats.uiengine.utilities.hiddenbrowser.HiddenHtmlElementState in project ats-framework by Axway.
the class HiddenHtmlElement method pressTabKey.
/**
* Simulate Tab key
*/
@Override
@PublicAtsApi
public void pressTabKey() {
new HiddenHtmlElementState(this).waitToBecomeExisting();
WebElement element = HiddenHtmlElementLocator.findElement(this);
new Actions(htmlUnitDriver).sendKeys(element, Keys.TAB).perform();
}
Aggregations