Skip to content

Faker Actions related to Hobbit

characterHobbit

Description: This function will generate a random character name from The Hobbit series

Input Format : DatasheetName:ColumnName

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

locationHobbit

Description: This function will generate a random location name from The Hobbit series

Input Format : DatasheetName:ColumnName

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

quoteHobbit

Description: This function will generate a random quote from The Hobbit series

Input Format : DatasheetName:ColumnName

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

thorinsCompanyHobbit

Description: This function will generate a random hobbit Thorins Company from The Hobbit series

Input Format : DatasheetName:ColumnName

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