Skip to content

Faker Actions related to University

universityName

Description: This function will generate a random university name

Input Format : DatasheetName:ColumnName

ObjectName Action Input Condition Reference
Synthetic Data 🟢 universityName DatasheetName:ColumnName ⬅ Store in Datasheet
@Action(object = ObjectType.FAKER, desc = "Generate a random university name", input = InputType.YES, condition = InputType.NO)
    public void universityName() {
        try {
            String strObj = Input;
            String universityName = faker.get(key).university().name();
            Report.updateTestLog(Action, "Generated data: " + universityName, Status.DONE);
            String sheetName = strObj.split(":", 2)[0];
            String columnName = strObj.split(":", 2)[1];
            userData.putData(sheetName, columnName, universityName);
        } catch (Exception ex) {
            Logger.getLogger(this.getClass().getName()).log(Level.SEVERE, "Exception during data generation", ex);
            Report.updateTestLog(Action, "Error generating university name: " + "\n" + ex.getMessage(), Status.DEBUG);
        }
    }

universityPrefix

Description: This function will generate a random university prefix

Input Format : DatasheetName:ColumnName

ObjectName Action Input Condition Reference
Synthetic Data 🟢 universityPrefix DatasheetName:ColumnName ⬅ Store in Datasheet
@Action(object = ObjectType.FAKER, desc = "Generate a random university prefix", input = InputType.YES, condition = InputType.NO)
    public void universityPrefix() {
        try {
            String strObj = Input;
            String universityPrefix = faker.get(key).university().prefix();
            Report.updateTestLog(Action, "Generated data: " + universityPrefix, Status.DONE);
            String sheetName = strObj.split(":", 2)[0];
            String columnName = strObj.split(":", 2)[1];
            userData.putData(sheetName, columnName, universityPrefix);
        } catch (Exception ex) {
            Logger.getLogger(this.getClass().getName()).log(Level.SEVERE, "Exception during data generation", ex);
            Report.updateTestLog(Action, "Error generating university name: " + "\n" + ex.getMessage(), Status.DEBUG);
        }
    }

universitySuffix

Description: This function will generate a random university suffix

Input Format : DatasheetName:ColumnName

ObjectName Action Input Condition Reference
Synthetic Data 🟢 universitySuffix DatasheetName:ColumnName ⬅ Store in Datasheet
@Action(object = ObjectType.FAKER, desc = "Generate a random university suffix", input = InputType.YES, condition = InputType.NO)
    public void universitySuffix() {
        try {
            String strObj = Input;
            String universitySuffix = faker.get(key).university().suffix();
            Report.updateTestLog(Action, "Generated data: " + universitySuffix, Status.DONE);
            String sheetName = strObj.split(":", 2)[0];
            String columnName = strObj.split(":", 2)[1];
            userData.putData(sheetName, columnName, universitySuffix);
        } catch (Exception ex) {
            Logger.getLogger(this.getClass().getName()).log(Level.SEVERE, "Exception during data generation", ex);
            Report.updateTestLog(Action, "Error generating university name: " + "\n" + ex.getMessage(), Status.DEBUG);
        }
    }