01: package org.jzonic.webtester.commands;
02:
03: import org.jzonic.webtester.WebTestContext;
04:
05: /**
06: * This command will print out the current HTML content to the console.
07: * Might be helpfull during debugging
08: * <br/>
09: * parameter: none
10: * <br/>
11: * examples:
12: * <br/>
13: * print_html
14: *
15: * @author Mecky
16: */
17: public class PrintHtmlCommand implements WebTestNode {
18:
19: public static final String COMMAND_NAME = "print_html";
20:
21: public void setParameter(String value) {
22: }
23:
24: public WebTestNodeResult execute(WebTestContext context) {
25: WebTestNodeResult result = new WebTestNodeResult(COMMAND_NAME,
26: "");
27: System.out.println(context.getHtmlText());
28: result.setSuccess(true);
29: return result;
30: }
31:
32: public String getName() {
33: return COMMAND_NAME;
34: }
35:
36: }
|