Functional Tester supports several types of log files, or no logging at all. You select the type of log file ( HTML Log, or Text Log) through the user interface. Each logged event has an associated message.
Functional Tester automatically logs the following events:
To include your own general messages in whatever type of log you specified through the user interface, use the logInfo method, as shown in this example:
if(AnAWTButtonButton(p1,0)isEnabled()) { logInfo("AWT button is enabled."); } else { logInfo("AWT button is not enabled."); }
You can log a test result by using the logTestResult method. The first parameter is a headline that describes the test. The second parameter is the result of the test (true for Pass, false for a failure),. An optional third parameter is for additional information. For example:
logTestResult("Text buffer comparison", TextField_text.equals(msExpect));
Here is another example that uses the third parameter for additional information:
if(TextField_text.equals(msExpect)) { logTestResult("Text buffer comparison", true); } else { logTestResult("Text buffer comparison", false, "Expected '"+TextField_text+"' but found '"+msExpect+"'"); }
If you want to write an error message to the log, use the logError method:
catch (Exception e) {logError("Exception e = "+e.toString());}
You can add a warning message to the log using the logWarning method:
logWarning("Your warning message goes here.");