Code example for ConsoleMessage

Methods: lineNumber, message

0
    } 
 
    public void appendConsoleMessage(ConsoleMessage consoleMessage) {
        StringBuilder output = getStringBuilderForType(OutputType.CONSOLE_MESSAGE);
 
        output.append("CONSOLE MESSAGE: line " + consoleMessage.lineNumber());
        output.append(": " + consoleMessage.message() + "\n");
    } 
 
    public void appendJsAlert(String message) {
        StringBuilder output = getStringBuilderForType(OutputType.JS_DIALOG);
 
        output.append("ALERT: ");
        output.append(message);
        output.append('\n');
    } 
 
    public void appendJsConfirm(String message) {
        StringBuilder output = getStringBuilderForType(OutputType.JS_DIALOG);
 
        output.append("CONFIRM: ");