use of com.axway.ats.uiengine.utilities.realbrowser.html.RealHtmlElementState in project ats-framework by Axway.
the class RealHtmlMultiSelectList method unsetValue.
/**
* unselect a value
*
* @param value the value to unselect
*/
@Override
@PublicAtsApi
public void unsetValue(String value) {
new RealHtmlElementState(this).waitToBecomeExisting();
WebElement element = RealHtmlElementLocator.findElement(this);
Select select = new Select(element);
// select.deselectByVisibleText( value ); // this method doesn't throw an exception if the option doesn't exist
for (WebElement option : select.getOptions()) {
if (option.getText().equals(value)) {
if (option.isSelected()) {
option.click();
UiEngineUtilities.sleep();
}
return;
}
}
throw new SeleniumOperationException("Option with label '" + value + "' not found. (" + this.toString() + ")");
}
use of com.axway.ats.uiengine.utilities.realbrowser.html.RealHtmlElementState in project ats-framework by Axway.
the class RealHtmlMultiSelectList method setValue.
/**
* select a value
*
* @param value the value to select
*/
@Override
@PublicAtsApi
public void setValue(String value) {
new RealHtmlElementState(this).waitToBecomeExisting();
try {
WebElement element = RealHtmlElementLocator.findElement(this);
Select select = new Select(element);
select.selectByVisibleText(value);
} catch (NoSuchElementException nsee) {
throw new SeleniumOperationException("Option with label '" + value + "' not found. (" + this.toString() + ")");
}
UiEngineUtilities.sleep();
}
use of com.axway.ats.uiengine.utilities.realbrowser.html.RealHtmlElementState in project ats-framework by Axway.
the class RealHtmlElement method setTextContent.
/**
* Set the content of the element
* @param content the new content
*/
@Override
@PublicAtsApi
public void setTextContent(String content) {
new RealHtmlElementState(this).waitToBecomeExisting();
WebElement element = RealHtmlElementLocator.findElement(this);
element.sendKeys(content);
}
use of com.axway.ats.uiengine.utilities.realbrowser.html.RealHtmlElementState in project ats-framework by Axway.
the class RealHtmlElement method pressTabKey.
/**
* Simulate Tab key
*/
@Override
@PublicAtsApi
public void pressTabKey() {
new RealHtmlElementState(this).waitToBecomeExisting();
WebElement element = RealHtmlElementLocator.findElement(this);
element.sendKeys(Keys.TAB);
}
use of com.axway.ats.uiengine.utilities.realbrowser.html.RealHtmlElementState in project ats-framework by Axway.
the class RealHtmlElement method doubleClick.
/**
* Simulate mouse double click action
*/
@Override
@PublicAtsApi
public void doubleClick() {
new RealHtmlElementState(this).waitToBecomeExisting();
WebElement element = RealHtmlElementLocator.findElement(this);
new Actions(webDriver).doubleClick(element).perform();
}
Aggregations