Dropdown & Checkbox Actions
SelectSingleByText
Description: This function is used to select a single value from a select type object.
Input Format : @Value
| ObjectName | Action | Input | Condition | Reference | |
|---|---|---|---|---|---|
| Object | SelectSingleByText | @value | PageName | ||
| Object | SelectSingleByText | Sheet:Column | PageName | ||
| Object | SelectSingleByText | %dynamicVar% | PageName | 
Inputs in the Input column can be either hardcoded (in this case the data is preceded by a "@"), passed from the data sheet (datasheet name : column name) or passed from a variable value (%variable name%), as given in the above example.
@Action(object = ObjectType.PLAYWRIGHT, desc = "Select item in [<Object>] which has text: [<Data>]", input = InputType.YES)
    public void SelectSingleByText() {
        try
        {
        Locator.selectOption(Data);
        Report.updateTestLog(Action, "Item '" + Data
                        + "' is selected" + " from list [" + ObjectName +"]", Status.DONE);
        }
        catch (Exception e){
            Logger.getLogger(this.getClass().getName()).log(Level.OFF, null, e);
            Report.updateTestLog("Could not perfom ["+Action+"] action", "Error: " + e.getMessage(),Status.FAIL);
        }
    }
SelectMultipleByText
Description: This function is used to select multiple values from a select type object.
Input Format : @Values seperated by Pipe. For example Value1|Value2|Value3|Value4
| ObjectName | Action | Input | Condition | Reference | |
|---|---|---|---|---|---|
| Object | SelectMultipleByText | @value | PageName | ||
| Object | SelectMultipleByText | Sheet:Column | PageName | ||
| Object | SelectMultipleByText | %dynamicVar% | PageName | 
Inputs in the Input column can be either hardcoded (in this case the data is preceded by a "@"), passed from the data sheet (datasheet name : column name) or passed from a variable value (%variable name%), as given in the above example.
@Action(object = ObjectType.PLAYWRIGHT, desc = "Select items [<Data>] of [<Object>] by visible Text", input = InputType.YES)
    public void SelectMultipleByText() {
        try
        {
        String options[] = Data.split("|");
        Locator.selectOption(options);
        Report.updateTestLog(Action, "Items '" + Data
                        + "' are selected" + " from list [" + ObjectName +"]", Status.DONE);
        }
        catch (Exception e){
            Logger.getLogger(this.getClass().getName()).log(Level.OFF, null, e);
            Report.updateTestLog("Could not perfom ["+Action+"] action", "Error: " + e.getMessage(),Status.FAIL);
        }
    }
SelectSingleByTextIfDataExists
Description:  This function is used to select a single value from a select type object if data exists, else that step will be ignored.
Input Format : @Expected Text
| ObjectName | Action | Input | Condition | Reference | |
|---|---|---|---|---|---|
| Object | SelectSingleByTextIfDataExists | @value | PageName | ||
| Object | SelectSingleByTextIfDataExists | Sheet:Column | PageName | ||
| Object | SelectSingleByTextIfDataExists | %dynamicVar% | PageName | 
Inputs in the Input column can be either hardcoded (in this case the data is preceded by a "@"), passed from the data sheet (datasheet name : column name) or passed from a variable value (%variable name%), as given in the above example.
@Action(object = ObjectType.PLAYWRIGHT, desc = "Select item in [<Object>] which has text: [<Data>] if it Data exists", input = InputType.YES)
    public void SelectSingleByTextIfDataExists() {
        Page.waitForLoadState();
        if (!Data.isEmpty()) {
            SelectSingleByText();
        } else {
            Report.updateTestLog(Action, "Data not present", Status.DONE);
        }
    }
SelectSingleByTextIfVisible
Description:  This function will check if an element is visible. If the element is visible, it will select a single value from a select type object, else that step will be ignored.
Input Format : @Expected Text
| ObjectName | Action | Input | Condition | Reference | |
|---|---|---|---|---|---|
| Object | SelectSingleByTextIfVisible | @value | PageName | ||
| Object | SelectSingleByTextIfVisible | Sheet:Column | PageName | ||
| Object | SelectSingleByTextIfVisible | %dynamicVar% | PageName | 
Inputs in the Input column can be either hardcoded (in this case the data is preceded by a "@"), passed from the data sheet (datasheet name : column name) or passed from a variable value (%variable name%), as given in the above example.
@Action(object = ObjectType.PLAYWRIGHT, desc = "Select item in [<Object>] if visible which has text: [<Data>]", input = InputType.YES)
    public void SelectSingleByTextIfVisible() {
        Page.waitForLoadState();
        if (Locator.isVisible()) {
            SelectSingleByText();
        } else {
            Report.updateTestLog(Action, "[" + ObjectName + "]" + " is not visible", Status.DONE);
        }
}
Check
Description: This function is used to check a check-box type object.
| ObjectName | Action | Input | Condition | Reference | |
|---|---|---|---|---|---|
| Object | Check | PageName | 
@Action(object = ObjectType.PLAYWRIGHT, desc = "Check the [<Object>] element")
    public void Check() {
        if (Locator != null) {
            if (Locator.isEnabled()) {
                if (!Locator.isChecked()) {
                    Locator.check();
                }
                if (Locator.isChecked()) {
                    Report.updateTestLog("check", "Checkbox '" + Locator
                            + "'  has been selected/checked successfully",
                            Status.DONE);
                } else {
                    Report.updateTestLog("check", "Checkbox '" + Locator
                            + "' couldn't be selected/checked", Status.FAIL);
                }
            } else {
                Report.updateTestLog("check", "Checkbox '" + Locator
                        + "' is not enabled", Status.FAIL);
            }
        } else {
            Report.updateTestLog(Action, "Object [" + ObjectName + "] not found", Status.FAIL);
        }
    }
Uncheck
Description: This function is used to uncheck a check-box type object.
| ObjectName | Action | Input | Condition | Reference | |
|---|---|---|---|---|---|
| Object | Uncheck | PageName | 
@Action(object = ObjectType.WEB, desc = "Uncheck the [<Object>] element")
    public void Uncheck() {
        if (Locator != null) {
            if (Locator.isEnabled()) {
                if (Locator.isChecked()) {
                    Locator.uncheck();
                }
                if (!Locator.isChecked()) {
                    Report.updateTestLog("uncheck", "Checkbox '" + Locator
                            + "'  has been un-checked successfully",
                            Status.DONE);
                } else {
                    Report.updateTestLog("uncheck", "Checkbox '" + Locator
                            + "' couldn't be un-checked", Status.FAIL);
                }
            } else {
                Report.updateTestLog("uncheck", "Checkbox '" + Locator
                        + "' is not enabled", Status.FAIL);
            }
        } else {
            Report.updateTestLog(Action, "Object[" + ObjectName + "] not found", Status.FAIL);
        }
    }
CheckIfVisible
Description:  This function will check if an element is visible. If the element is visible, it will check a check-box type object, else that step will be ignored.
Input Format : @Expected Text
| ObjectName | Action | Input | Condition | Reference | |
|---|---|---|---|---|---|
| Object | CheckIfVisible | @value | PageName | ||
| Object | CheckIfVisible | Sheet:Column | PageName | ||
| Object | CheckIfVisible | %dynamicVar% | PageName | 
Inputs in the Input column can be either hardcoded (in this case the data is preceded by a "@"), passed from the data sheet (datasheet name : column name) or passed from a variable value (%variable name%), as given in the above example.
SetChecked
Description:  This function will check/uncheck a checkbox type object.
| ObjectName | Action | Input | Condition | Reference | 
|---|---|---|---|---|
| Object | SetChecked | 
@Action(object = ObjectType.PLAYWRIGHT, desc = "Check/Uncheck the [<Object>] element based on Data", input = InputType.YES)
    public void SetChecked() {
        try {
            Locator.setChecked(Boolean.parseBoolean(Data));
            Report.updateTestLog(Action, "Setting checked status of" + "[" + ObjectName + "] as [" + Data + "]", Status.DONE);
        } catch (PlaywrightException e) {
            Logger.getLogger(this.getClass().getName()).log(Level.OFF, null, e);
            Report.updateTestLog("Could not perfom [" + Action + "] action", "Error: " + e.getMessage(), Status.FAIL);
        }
    }
SetCheckedifDataExists
Description:  This function will check/uncheck a checkbox type object based on input data.
Input Format : @Expected Text
| ObjectName | Action | Input | Condition | Reference | |
|---|---|---|---|---|---|
| Object | SetCheckedifDataExists | @value | PageName | ||
| Object | SetCheckedifDataExists | Sheet:Column | PageName | ||
| Object | SetCheckedifDataExists | %dynamicVar% | PageName | 
Inputs in the Input column can be either hardcoded (in this case the data is preceded by a "@"), passed from the data sheet (datasheet name : column name) or passed from a variable value (%variable name%), as given in the above example.