Skip to content

Tap


Tap

Description: This function is used to tap the element.

ObjectName Action Input Condition Reference
mobileObject 🟢 Tap
@Action(object = ObjectType.APP, desc = "Tap the [<Object>] ")
public void Tap() {
    if (elementEnabled()) {
        Element.click();
        Report.updateTestLog(Action, "Taping on " + ObjectName, Status.DONE);

    } else {
        throw new ElementException(ExceptionType.Element_Not_Enabled, ObjectName);
    }
}

TapIfExists

Description: This function will tap the element if it exists.

ObjectName Action Input Condition Reference
mobileObject 🟢 TapIfExists
@Action(object = ObjectType.APP, desc = "Tap the [<Object>] if it exists")
public void TapIfExists() {
    if (Element != null) {
        Tap();
    } else {
        Report.updateTestLog(Action, "Element [" + ObjectName + "] not Exists", Status.DONE);
    }
}

TapIfVisible

Description: This function will tap the element if it is displayed.

ObjectName Action Input Condition Reference
mobileObject 🟢 TapIfVisible
@Action(object = ObjectType.APP, desc = "Tap the [<Object>] if it is displayed")
public void TapIfVisible() {
    if (Element != null) {
        if (Element.isDisplayed()) {
            Tap();
        } else {
            Report.updateTestLog(Action, "Element [" + ObjectName + "] not Visible", Status.DONE);
        }
    } else {
        Report.updateTestLog(Action, "Element [" + ObjectName + "] not Exists", Status.DONE);
    }
}

TapAndHoldElement

Description: This function is used to perform tap and hold operation on an element.

ObjectName Action Input Condition Reference
mobileObject 🟢 TapAndHoldElement
@Action(object = ObjectType.APP, desc = "Tap and hold the [<Object>] element ")
public void TapAndHoldElement() {
    if (elementEnabled()) {
        new Actions(mDriver).clickAndHold(Element).build().perform();
        Report.updateTestLog(Action, "Tap and hold done", Status.DONE);
    } else {
        throw new ElementException(ElementException.ExceptionType.Element_Not_Enabled, ObjectName);
    }
}

TapInputByLabel

Description: This function will tap on an element whose label is provided in the element.

ObjectName Action Input Condition Reference
mobileObject 🟢 TapInputByLabel
@Action(object = ObjectType.APP, desc = "Tap on an element whose label is provided in the [<Object>]")
public void TapInputByLabel() {
    cc.Element = findInputElementByLabelTextByXpath();
    new Basic(cc).Tap();
}

TapInputByText

Description: This function will tap on the element whose label is provided in the input.

Input Format : @Expected Text

ObjectName Action Input Condition Reference
Mobile 🟢 TapInputByText @value ⬅ Hardcoded Input
Mobile 🟢 TapInputByText Sheet:Column ⬅ Input from Datasheet
Mobile 🟢 TapInputByText %dynamicVar% ⬅ Input from variable
@Action(object = ObjectType.MOBILE, desc = "Tap on the element whose label is provided in the [<Input>]", input = InputType.YES)
public void TapInputByText() {
    cc.Element = findInputElementByLabelTextByXpath(Data);// Another variant
    new Basic(cc).Tap();
}

Tap_Relative

Description: This function will tap on element based on parent object

ObjectName Action Input Condition Reference
mobileObject 🟢 Tap_Relative PageName
@Action(object = ObjectType.APP, desc = "Tap on element based on parent [<Object>]", condition = InputType.YES)
public void Tap_Relative() {
    doRelative(RelativeAction.TAP);
}