Skip to content

Faker Actions related to Code

isbn10

Description: This function will generate a random ISBN-10 number

Input Format : DatasheetName:ColumnName

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

isbn13

Description: This function will generate a random ISBN-13 number

Input Format : DatasheetName:ColumnName

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

gtin8

Description: This function will generate a random GTIN-8 code number

Input Format : DatasheetName:ColumnName

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

gtin13

Description: This function will generate a random GTIN-13 code number

Input Format : DatasheetName:ColumnName

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

ean8

Description: This function will generate a random EAN-8 code

Input Format : DatasheetName:ColumnName

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

ean13

Description: This function will generate a random EAN-13 code

Input Format : DatasheetName:ColumnName

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

asin

Description: This function will generate a random ASIN number

Input Format : DatasheetName:ColumnName

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

imei

Description: This function will generate a random IMEI number

Input Format : DatasheetName:ColumnName

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

isbnGroup

Description: This function will generate a random ISBN group

Input Format : DatasheetName:ColumnName

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

isbnGs1

Description: This function will generate a random ISBN GS1 number

Input Format : DatasheetName:ColumnName

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

isbnRegistrant

Description: This function will generate a random ISBN registrant number

Input Format : DatasheetName:ColumnName

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

isbn10WithSeparator

Description: This function will generate a random ISBN-10 number with separator

Input Format : DatasheetName:ColumnName

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

isbn13WithSeparator

Description: This function will generate a random ISBN-13 number with separator

Input Format : DatasheetName:ColumnName

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