use of com.axway.ats.uiengine.utilities.realbrowser.html.RealHtmlElementState in project ats-framework by Axway.
the class RealHtmlMultiSelectList method getValues.
/**
* @return the selected values
*/
@Override
@PublicAtsApi
public String[] getValues() {
new RealHtmlElementState(this).waitToBecomeExisting();
WebElement element = RealHtmlElementLocator.findElement(this);
Select select = new Select(element);
List<WebElement> selectedOptions = select.getAllSelectedOptions();
String[] result = new String[selectedOptions.size()];
int i = 0;
for (WebElement selectedOption : selectedOptions) {
result[i++] = selectedOption.getText();
}
return result;
}
use of com.axway.ats.uiengine.utilities.realbrowser.html.RealHtmlElementState in project ats-framework by Axway.
the class RealHtmlElement method rightClick.
/**
* Simulate mouse right click action
*/
@Override
@PublicAtsApi
public void rightClick() {
new RealHtmlElementState(this).waitToBecomeExisting();
WebElement element = RealHtmlElementLocator.findElement(this);
new Actions(webDriver).contextClick(element).perform();
}
use of com.axway.ats.uiengine.utilities.realbrowser.html.RealHtmlElementState in project ats-framework by Axway.
the class RealHtmlElement method pressEnterKey.
/**
* Simulate Enter key
*/
@Override
@PublicAtsApi
public void pressEnterKey() {
new RealHtmlElementState(this).waitToBecomeExisting();
WebElement element = RealHtmlElementLocator.findElement(this);
if (webDriver instanceof PhantomJSDriver) {
element.sendKeys(Keys.ENTER);
} else {
element.sendKeys(Keys.RETURN);
}
}
use of com.axway.ats.uiengine.utilities.realbrowser.html.RealHtmlElementState in project ats-framework by Axway.
the class RealHtmlElement 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 RealHtmlElementState(this).waitToBecomeExisting();
WebElement source = RealHtmlElementLocator.findElement(this);
WebElement target = RealHtmlElementLocator.findElement(targetElement);
Actions actionBuilder = new Actions(webDriver);
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( webDriver ).dragAndDrop( source, target ).perform();
}
use of com.axway.ats.uiengine.utilities.realbrowser.html.RealHtmlElementState in project ats-framework by Axway.
the class RealHtmlElement method pressSpaceKey.
/**
* Simulate Space key
*/
@Override
@PublicAtsApi
public void pressSpaceKey() {
new RealHtmlElementState(this).waitToBecomeExisting();
WebElement element = RealHtmlElementLocator.findElement(this);
element.sendKeys(Keys.SPACE);
}
Aggregations