Skip to content

Faker Actions related to Name

firstName

Description: This function will generate random first name

Input Format : DatasheetName:ColumnName

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

lastName

Description: This function will generate random last name

Input Format : DatasheetName:ColumnName

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

fullName

Description: This function will generate random full name

Input Format : DatasheetName:ColumnName

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

namePrefix

Description: This function will generate random name with prefix

Input Format : DatasheetName:ColumnName

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

nameSuffix

Description: This function will generate random name with suffix

Input Format : DatasheetName:ColumnName

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

nameTitle

Description: This function will generate random name title

Input Format : DatasheetName:ColumnName

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

username

Description: This function will generate random username

Input Format : DatasheetName:ColumnName

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

name

Description: This function will generate random name

Input Format : DatasheetName:ColumnName

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

nameWithMiddleName

Description: This function will generate random name with middle name

Input Format : DatasheetName:ColumnName

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