Faker Actions related to Bool
randomBool
Description: This function will generate a random bool value
Input Format : DatasheetName:ColumnName
ObjectName | Action | Input | Condition | Reference | |
---|---|---|---|---|---|
Synthetic Data | randomBool |
DatasheetName:ColumnName |
@Action(object = ObjectType.FAKER, desc = "Generate a random boolean value", input = InputType.YES, condition = InputType.NO)
public void randomBool() {
try {
String strObj = Input;
boolean randomBool = faker.get(key).bool().bool();
Report.updateTestLog(Action, "Generated data: " + randomBool, Status.DONE);
String sheetName = strObj.split(":", 2)[0];
String columnName = strObj.split(":", 2)[1];
userData.putData(sheetName, columnName, Boolean.toString(randomBool));
} 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);
}
}