Debian Codegraph @

README

raw
1 NAME
2 Webinject - Perl Module for testing web services
3
4 SYNOPSIS
5 use Webinject;
6 my $webinject = Webinject->new();
7 $webinject->engine();
8
9 DESCRIPTION
10 WebInject is a free tool for automated testing of web applications and
11 web services. It can be used to test individual system components that
12 have HTTP interfaces (JSP, ASP, CGI, PHP, AJAX, Servlets, HTML Forms,
13 XML/SOAP Web Services, REST, etc), and can be used as a test harness to
14 create a suite of [HTTP level] automated functional, acceptance, and
15 regression tests. A test harness allows you to run many test cases and
16 collect/report your results. WebInject offers real-time results display
17 and may also be used for monitoring system response times.
18
19 CONSTRUCTOR
20 new ( [ARGS] )
21 Creates an "Webinject" object.
22
23 reporttype
24 possible values are 'standard', 'nagios', 'nagios2', 'mrtg' or
25 'external:'
26
27 nooutput
28 suppress all output to STDOUT, create only logfiles
29
30 break_on_errors
31 stop after the first testcase fails, otherwise Webinject would go on
32 and execute all tests regardless of the previous case.
33
34 timeout
35 Default timeout is 180seconds. Timeout starts again for every
36 testcase.
37
38 useragent
39 Set the useragent used in HTTP requests. Default is 'Webinject'.
40
41 max_redirect
42 Set maximum number of HTTP redirects. Default is 0.
43
44 proxy
45 Sets a proxy which is then used for http and https requests.
46
47 ex.: http://proxy.company.net:3128
48
49 with authentication:
50
51 ex.: http://user:[email protected]:3128
52
53 output_dir
54 Output directory where all logfiles will go to. Defaults to current
55 directory.
56
57 globalhttplog
58 Can be 'yes' or 'onfail'. Will log the http request and response to
59 a http.log file.
60
61 httpauth
62 Provides credentials for webserver authentications. The format is:
63
64 ['servername', 'portnumber', 'realm-name', 'username', 'password']
65
66 baseurl
67 the value can be used as {BASEURL} in the test cases
68
69 baseurl1
70 the value can be used as {BASEURL1} in the test cases
71
72 baseurl2
73 the value can be used as {BASEURL2} in the test cases
74
75 standaloneplot
76 can be "on" or "off". Default is off. Create gnuplot graphs when
77 enabled.
78
79 graphtype
80 Defaults to 'lines'
81
82 gnuplot
83 Defines the path to your gnuplot binary.
84
85 postbodybasedir
86 Path to a directory from which all relative test case postbody
87 directives are based.
88
89 When test cases include a "postbody" directive with a "file=>..."
90 value, and that value is a relative location, Webinject will prepend
91 this directory path.
92
93 If not supplied, the directory containing the current test case file
94 is prepended to any relative "file=>" values.
95
96 METHODS
97 engine
98 start the engine of webinject
99
100 TEST CASES
101 Parameters
102 addcookie
103 When added to a test case, this adds a cookie to the cookie jar
104 prior to the test case request being sent (i.e. the test case this
105 is attached to will include any cookies specified in this
106 parameter). This is useful for cases where a cookie is set outside
107 of a Set-Cookie directive in the response header. This parameter
108 takes a comma-delimited list of fields that configure the cookie;
109 the fields for this parameter are a direct one-to-one correllation
110 with the parameters to the HTTP::Cookies::set_cookie method. As
111 well, multiple cookies can be defined by separating with a '|'
112 character as with the addheader parameter.
113
114 The comma-delimited list of fields are as follows.
115
116 addcookie="version,name,value,path,domain,port,path_spec,secure,maxa
117 ge,discard"
118
119 version - Cookie-spec version number
120
121 name - Cookie name.
122
123 value - Cookie value.
124
125 path - The URL path where the cookie is set.
126
127 domain - The domain under which the cookie is set.
128
129 port - The port on which the cookie is set.
130
131 path_spec - Boolean. Set if the cookie is valid only under 'path' or
132 the entire domain.
133
134 secure - Boolean. If true (1), the cookie is only sent over secure
135 connections
136
137 maxage - The time in seconds the cookie is valid for.
138
139 discard - Boolean. Do not send in future requests and destroy upon
140 the next cookie jar save.
141
142 parseresponse
143 Parse a string from the HTTP response for use in subsequent
144 requests. This is mostly used for passing Session ID's, but can be
145 applied to any case where you need to pass a dynamically generated
146 value. It takes the arguments in the format
147 "leftboundary|rightboundary", and an optional third argument
148 "leftboundary|rightboundary|escape|decode" when you want to force
149 escaping of all non-alphanumeric characters (in case there is a
150 wrong configuration of Apache server it will push encoded HTML
151 characters (/ = /, : = :, ... ) to the Webinject and decode
152 serve to translate them into normal characters. See the "Session
153 Handling and State Management - Parsing Response Data & Embedded
154 Session ID's" section of this manual for details and examples on how
155 to use this parameter.
156
157 Note: You may need to prepend a backslash before certain reserved
158 characters when parsing (sorry that is rather vague).
159
160 Note: Newlines (\n) are also valid boundaries and are useful when
161 you need to use the end of the line as a boundary.
162
163 parseresponse1 Additional parameter for response parsing.
164
165 parseresponse2 Additional parameter for response parsing.
166
167 parseresponse3 Additional parameter for response parsing.
168
169 parseresponse4 Additional parameter for response parsing.
170
171 parseresponse5 Additional parameter for response parsing.
172
173 EXAMPLE TEST CASE
174 <testcases>
175 <case
176 id = "1"
177 description1 = "Sample Test Case"
178 method = "get"
179 url = "{BASEURL}/test.jsp"
180 verifypositive = "All tests succeded"
181 warning = "5"
182 critical = "15"
183 label = "testpage"
184 errormessage = "got error: {PARSERESPONSE}"
185 />
186 </testcases>
187
188 detailed description about the syntax of testcases can be found on the
189 Webinject homepage.
190
191 SEE ALSO
192 For more information about webinject visit http://www.webinject.org
193
194 AUTHOR
195 Corey Goldberg, <[email protected]>
196
197 Sven Nierlein, <[email protected]>
198
199 COPYRIGHT AND LICENSE
200 Copyright (C) 2010 by Sven Nierlein
201
202 Copyright (C) 2004-2006 by Corey Goldberg
203
204 This library is free software; you can redistribute it under the GPL2
205 license.
206