use of com.axway.ats.common.PublicAtsApi in project ats-framework by Axway.
the class SwingCheckBox method unCheck.
/**
* Uncheck the CheckBox
* @throws VerificationException if the element doesn't exist
*/
@Override
@PublicAtsApi
public void unCheck() {
new SwingElementState(this).waitToBecomeExisting();
((JCheckBoxFixture) SwingElementLocator.findFixture(this)).uncheck();
}
use of com.axway.ats.common.PublicAtsApi in project ats-framework by Axway.
the class SwingComboBox method setValue.
/**
* Set ComboBox value
* @param value the ComboBox value to set
* @throws VerificationException if the element doesn't exist
*/
@SuppressWarnings("unchecked")
@Override
@PublicAtsApi
public void setValue(String value) {
new SwingElementState(this).waitToBecomeExisting();
JComboBoxFixture comboBoxFixture = null;
try {
comboBoxFixture = ((JComboBoxFixture) SwingElementLocator.findFixture(this));
comboBoxFixture.selectItem(value);
} catch (LocationUnavailableException lue) {
// if the element is editable we'll enter the new value
if (comboBoxFixture != null && comboBoxFixture.component().isEditable()) {
try {
comboBoxFixture.component().addItem(value);
comboBoxFixture.selectItem(value);
} catch (LocationUnavailableException e) {
throw new UiElementException(e.getMessage(), this);
}
} else {
throw new UiElementException(lue.getMessage(), this);
}
}
}
use of com.axway.ats.common.PublicAtsApi in project ats-framework by Axway.
the class SwingComponent method doubleClick.
/**
* Simulates a user double click over the GUI component.
*
*/
@PublicAtsApi
public void doubleClick() {
new SwingElementState(this).waitToBecomeExisting();
click(MouseClickInfo.leftButton().times(2));
}
use of com.axway.ats.common.PublicAtsApi in project ats-framework by Axway.
the class SwingComponent method drag.
/**
* Simulates a user dragging of this component
*
*/
@PublicAtsApi
public void drag() {
new SwingElementState(this).waitToBecomeExisting();
ComponentFixture<? extends Component> componentFixture = SwingElementLocator.findFixture(this);
ComponentDragAndDrop componentDragAndDrop = new ComponentDragAndDrop(componentFixture.robot);
componentDragAndDrop.drag(componentFixture.target, getComponentCenterLocation(componentFixture.target));
}
use of com.axway.ats.common.PublicAtsApi in project ats-framework by Axway.
the class RealHtmlTable method getColumnCount.
/**
* @return how many columns this table has
*/
@PublicAtsApi
public int getColumnCount() {
new RealHtmlElementState(this).waitToBecomeExisting();
String css = this.getElementProperty("_css");
try {
if (!StringUtils.isNullOrEmpty(css)) {
StringBuilder sb = new StringBuilder(css);
sb.append(" tr:nth-child(1) td");
int count = webDriver.findElements(By.cssSelector(sb.toString())).size();
sb = new StringBuilder(css);
sb.append(" tr:nth-child(1) th");
count += webDriver.findElements(By.cssSelector(sb.toString())).size();
return count;
} else {
// get elements matching the following xpath
return this.webDriver.findElements(By.xpath("(" + properties.getInternalProperty(HtmlElementLocatorBuilder.PROPERTY_ELEMENT_LOCATOR) + "//tr[th or td])[1]/*")).size();
}
} catch (Exception e) {
throw new SeleniumOperationException(this, "getColumnsCount", e);
}
}
Aggregations