Skip to content

Faker Actions related to Currency

currencyName

Description: This function will generate a random currency name

Input Format : DatasheetName:ColumnName

ObjectName Action Input Condition Reference
Synthetic Data 🟢 currencyName DatasheetName:ColumnName ⬅ Store in Datasheet
@Action(object = ObjectType.FAKER, desc = "Generate a random currency name", input = InputType.YES, condition = InputType.NO)
    public void currencyName() {
        try {
            String strObj = Input;
            String currency = faker.get(key).currency().name();
            Report.updateTestLog(Action, "Generated data: " + currency, Status.DONE);
            String sheetName = strObj.split(":", 2)[0];
            String columnName = strObj.split(":", 2)[1];
            userData.putData(sheetName, columnName, currency);
        } 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);
        }
    }

CurrencyCode

Description: This function will generate a random currency code

Input Format : DatasheetName:ColumnName

ObjectName Action Input Condition Reference
Synthetic Data 🟢 CurrencyCode DatasheetName:ColumnName ⬅ Store in Datasheet
@Action(object = ObjectType.FAKER, desc = "Generate a random currency code", input = InputType.YES, condition = InputType.NO)
    public void CurrencyCode() {
        try {
            String strObj = Input;
            String currencyCode = faker.get(key).currency().code();
            Report.updateTestLog(Action, "Generated data: " + currencyCode, Status.DONE);
            String sheetName = strObj.split(":", 2)[0];
            String columnName = strObj.split(":", 2)[1];
            userData.putData(sheetName, columnName, currencyCode);
        } 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);
        }
    }