use of com.axway.ats.uiengine.utilities.realbrowser.html.RealHtmlElementState in project ats-framework by Axway.
the class RealHtmlRadioList method select.
/**
* set the selected value
*
* @param value the value to select(this is the 'value' attribute of the radio button)
*/
@PublicAtsApi
public void select(String value) {
new RealHtmlElementState(this).waitToBecomeExisting();
WebElement element = RealHtmlElementLocator.findElement(this, "[@value='" + value + "']", true);
if (!element.isEnabled()) {
throw new UnsupportedOperationException("You may not select a disabled element." + toString());
}
element.click();
UiEngineUtilities.sleep();
}
use of com.axway.ats.uiengine.utilities.realbrowser.html.RealHtmlElementState in project ats-framework by Axway.
the class RealHtmlSingleSelectList method getValue.
/**
* @return the single selection value
*/
@Override
@PublicAtsApi
public String getValue() {
new RealHtmlElementState(this).waitToBecomeExisting();
WebElement element = RealHtmlElementLocator.findElement(this);
Select select = new Select(element);
if (!select.getAllSelectedOptions().isEmpty()) {
return select.getFirstSelectedOption().getText();
}
throw new SeleniumOperationException("There is no selected 'option' in " + this.toString());
}
use of com.axway.ats.uiengine.utilities.realbrowser.html.RealHtmlElementState in project ats-framework by Axway.
the class RealHtmlSingleSelectList method setValue.
/**
* set the single selection 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 RealHtmlButton method doClick.
private void doClick() {
try {
new RealHtmlElementState(this).waitToBecomeExisting();
WebElement element = RealHtmlElementLocator.findElement(this);
try {
element.click();
} catch (ElementNotVisibleException enve) {
if (!UiEngineConfigurator.getInstance().isWorkWithInvisibleElements()) {
throw enve;
}
((JavascriptExecutor) webDriver).executeScript("arguments[0].click()", element);
}
} catch (Exception e) {
((AbstractRealBrowserDriver) super.getUiDriver()).clearExpectedPopups();
throw new SeleniumOperationException(this, "click", e);
}
UiEngineUtilities.sleep();
((AbstractRealBrowserDriver) super.getUiDriver()).handleExpectedPopups();
}
use of com.axway.ats.uiengine.utilities.realbrowser.html.RealHtmlElementState in project ats-framework by Axway.
the class RealHtmlCheckBox method unCheck.
/**
* Uncheck the check box
*/
@Override
@PublicAtsApi
public void unCheck() {
new RealHtmlElementState(this).waitToBecomeExisting();
WebElement checkBoxElement = RealHtmlElementLocator.findElement(this);
if (!checkBoxElement.isEnabled()) {
throw new UnsupportedOperationException("You may not uncheck a disabled element." + toString());
}
if (checkBoxElement.isSelected()) {
checkBoxElement.click();
}
UiEngineUtilities.sleep();
}
Aggregations