Following on from the post ‘Manual validation with test automation using OpenScript’, you may want to check that the value that you input falls within a certain range.

To do this you can add the following code (or similar) to the doManualTest() method:

public void doManualTest() throws Exception {

int messageType = JOptionPane.INFORMATION_MESSAGE;

String manual_result = JOptionPane.showInputDialog(null, “Now perform manual check for price”,

“Input Dialog Box”, messageType);

info(“Price: ” + manual_result); //output to results report

int i = Integer.parseInt(manual_result.trim());

if (i >= 1 && i <=100) {

info(“Number within range 1 – 100”);

} else {

info(“Number out of range 1 – 100”);