Search in sources :

Example 6 with MobileElementState

use of com.axway.ats.uiengine.utilities.mobile.MobileElementState in project ats-framework by Axway.

the class MobileTextBox method pressEnterKey.

@PublicAtsApi
public void pressEnterKey() {
    new MobileElementState(this).waitToBecomeExisting();
    try {
        WebElement textElement = MobileElementFinder.findElement(appiumDriver, this);
        textElement.sendKeys("\n");
    } catch (Exception se) {
        throw new MobileOperationException(this, "pressEnterKey", se);
    }
    // think time
    UiEngineUtilities.sleep();
}
Also used : MobileOperationException(com.axway.ats.uiengine.exceptions.MobileOperationException) WebElement(org.openqa.selenium.WebElement) VerifyNotEqualityException(com.axway.ats.uiengine.exceptions.VerifyNotEqualityException) MobileOperationException(com.axway.ats.uiengine.exceptions.MobileOperationException) VerifyEqualityException(com.axway.ats.uiengine.exceptions.VerifyEqualityException) MobileElementState(com.axway.ats.uiengine.utilities.mobile.MobileElementState) PublicAtsApi(com.axway.ats.common.PublicAtsApi)

Example 7 with MobileElementState

use of com.axway.ats.uiengine.utilities.mobile.MobileElementState in project ats-framework by Axway.

the class MobileTextBox method setValue.

/**
     * Set the Text Box value
     *
     * @param value
     */
@PublicAtsApi
public MobileTextBox setValue(String value) {
    new MobileElementState(this).waitToBecomeExisting();
    try {
        WebElement textElement = MobileElementFinder.findElement(appiumDriver, this);
        textElement.clear();
        textElement.sendKeys(value);
    } catch (Exception se) {
        throw new MobileOperationException(this, "setValue", se);
    }
    // think time
    UiEngineUtilities.sleep();
    return this;
}
Also used : MobileOperationException(com.axway.ats.uiengine.exceptions.MobileOperationException) WebElement(org.openqa.selenium.WebElement) VerifyNotEqualityException(com.axway.ats.uiengine.exceptions.VerifyNotEqualityException) MobileOperationException(com.axway.ats.uiengine.exceptions.MobileOperationException) VerifyEqualityException(com.axway.ats.uiengine.exceptions.VerifyEqualityException) MobileElementState(com.axway.ats.uiengine.utilities.mobile.MobileElementState) PublicAtsApi(com.axway.ats.common.PublicAtsApi)

Aggregations

PublicAtsApi (com.axway.ats.common.PublicAtsApi)7 MobileOperationException (com.axway.ats.uiengine.exceptions.MobileOperationException)7 MobileElementState (com.axway.ats.uiengine.utilities.mobile.MobileElementState)7 VerificationException (com.axway.ats.uiengine.exceptions.VerificationException)5 WebElement (org.openqa.selenium.WebElement)5 VerifyEqualityException (com.axway.ats.uiengine.exceptions.VerifyEqualityException)2 VerifyNotEqualityException (com.axway.ats.uiengine.exceptions.VerifyNotEqualityException)2 AndroidDriver (io.appium.java_client.android.AndroidDriver)2 Actions (org.openqa.selenium.interactions.Actions)2 MobileDriver (com.axway.ats.uiengine.MobileDriver)1 Dimension (org.openqa.selenium.Dimension)1 JavascriptExecutor (org.openqa.selenium.JavascriptExecutor)1