Skip to content

ByLabel Actions


setInputByLabel

Description: This function is used to set the expected text to an input element that is adjacent to the provided label element.

Input Format : @Expected Text

ObjectName Action Input Condition Reference
APP 🟢 setInputByLabel @value ⬅ Hardcoded Input
APP 🟢 setInputByLabel Sheet:Column ⬅ Input from Datasheet
APP 🟢 setInputByLabel %dynamicVar% ⬅ Input from variable
@Action(object = ObjectType.APP, desc = "Set the data [<Data>] to an input element that is adjacent to the provided label element [<Object>]", input = InputType.YES)
public void setInputByLabel() {
    cc.Element = findInputElementByLabelTextByXpath();
    new Basic(cc).Set();
}

TapInputByLabel

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

ObjectName Action Input Condition Reference
APP 🟢 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
APP 🟢 TapInputByText @value ⬅ Hardcoded Input
APP 🟢 TapInputByText Sheet:Column ⬅ Input from Datasheet
APP 🟢 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();
}

submitInputByLabel

Description: This function is used to submit the input element adjacent to the provided label element.

ObjectName Action Input Condition Reference
APP 🟢 submitInputByLabel
@Action(object = ObjectType.APP, desc = "Submit input element adjacent to the provided label element [<Object>]")
public void submitInputByLabel() {
    cc.Element = findInputElementByLabelTextByXpath();
    new Basic(cc).Submit();
}

assertElementTextByLabel

Description: This function is used to assert if the element text adjacent to provided label element equals the expected data.

Input Format : @Expected Text

ObjectName Action Input Condition Reference
APP 🟢 assertElementTextByLabel @value ⬅ Hardcoded Input
APP 🟢 assertElementTextByLabel Sheet:Column ⬅ Input from Datasheet
APP 🟢 assertElementTextByLabel %dynamicVar% ⬅ Input from variable
@Action(object = ObjectType.APP, desc = "Assert if [<Object>]'s Text adjacent to provided label element Equals [<Data>]", input = InputType.YES)
public void assertElementTextByLabel() {
    cc.Element = findInputElementByLabelTextByXpath();
    new Text(cc).assertElementTextEquals();
}

assertElementTextContainsByLabel

Description: This function is used to assert if the element text adjacent to provided label element contains the expected data.

Input Format : @Expected Text

ObjectName Action Input Condition Reference
APP 🟢 assertElementTextContainsByLabel @value ⬅ Hardcoded Input
APP 🟢 assertElementTextContainsByLabel Sheet:Column ⬅ Input from Datasheet
APP 🟢 assertElementTextContainsByLabel %dynamicVar% ⬅ Input from variable
@Action(object = ObjectType.APP, desc = "Assert if [<Object>]'s Text adjacent to provided label element Contains [<Data>]", input = InputType.YES)
public void assertElementTextContainsByLabel() {
    cc.Element = findInputElementByLabelTextByXpath();
    new Text(cc).assertElementTextContains();
}