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