use of com.axway.ats.common.PublicAtsApi in project ats-framework by Axway.
the class SwingSingleSelectList method getValue.
/**
* Get SingleSelectList value
*
* @throws VerificationException if the element doesn't exist
*/
@Override
@PublicAtsApi
public String getValue() {
new SwingElementState(this).waitToBecomeExisting();
String[] selections = ((JListFixture) SwingElementLocator.findFixture(this)).selection();
if (selections.length > 0) {
return selections[0];
}
return "";
}
use of com.axway.ats.common.PublicAtsApi in project ats-framework by Axway.
the class SwingSingleSelectList method setValue.
/**
* Set SingleSelectList value
*
* @param value the value to set
* @throws VerificationException if the element doesn't exist
*/
@Override
@PublicAtsApi
public void setValue(String value) {
new SwingElementState(this).waitToBecomeExisting();
((JListFixture) SwingElementLocator.findFixture(this)).selectItem(value);
}
use of com.axway.ats.common.PublicAtsApi in project ats-framework by Axway.
the class SwingSingleSelectList method clearSelection.
/**
* Clears the selection
*
* @throws VerificationException if the element doesn't exist
*/
@PublicAtsApi
public void clearSelection() {
new SwingElementState(this).waitToBecomeExisting();
((JListFixture) SwingElementLocator.findFixture(this)).clearSelection();
}
use of com.axway.ats.common.PublicAtsApi in project ats-framework by Axway.
the class MobileElement method clickIfExists.
// public T click() {
//
// new MobileElementState( this ).waitToBecomeExisting();
//
// try {
// try {
// MobileElementFinder.findElement( appiumDriver, this ).click();
// } catch( ElementNotVisibleException enve ) { // element is not currently visible and may not be manipulated
//
// new MobileElementState( this ).waitToBecomeDisplayed();
// MobileElementFinder.findElement( appiumDriver, this ).click();
// }
// return ( T ) this;
// } catch( Exception e ) {
// throw new MobileOperationException( this, "click", e );
// }
// }
/**
* Click/tap the element if exists.
*
* @param waitingTimeout timeout in milliseconds to wait for the element to appear
*/
@PublicAtsApi
public boolean clickIfExists(int waitingTimeout) {
int currentStateChangeDelay = UiEngineConfigurator.getInstance().getElementStateChangeDelay();
try {
UiEngineConfigurator.getInstance().setElementStateChangeDelay(waitingTimeout);
appiumDriver.manage().timeouts().implicitlyWait(waitingTimeout, TimeUnit.MILLISECONDS);
long endTime = System.currentTimeMillis() + waitingTimeout;
new MobileElementState(this).waitToBecomeExisting();
// the element exists but may be still not clickable
do {
try {
MobileElementFinder.findElement(appiumDriver, this).click();
return true;
} catch (Exception e) {
}
UiEngineUtilities.sleep(500);
} while (endTime - System.currentTimeMillis() > 0);
} catch (VerificationException ve) {
// do nothing, the element doesn't exist
} finally {
UiEngineConfigurator.getInstance().setElementStateChangeDelay(currentStateChangeDelay);
appiumDriver.manage().timeouts().implicitlyWait(currentStateChangeDelay, TimeUnit.MILLISECONDS);
}
return false;
}
use of com.axway.ats.common.PublicAtsApi in project ats-framework by Axway.
the class SwingMenuItem method click.
/**
* Click menu item
* @throws VerificationException if the element doesn't exist
*/
@Override
@PublicAtsApi
public void click() {
new SwingElementState(this).waitToBecomeExisting();
((JMenuItemFixture) SwingElementLocator.findFixture(this)).click();
}
Aggregations