WebAccept
The web testing tool

WebAccept tasks reference

Version 1.1.0

Here's the list of all WebAccept tasks and how to use them.

Task Description
assert Validates that the response is valid
echo Echo text to the console
form Post or get an HTML form
get Loads the resulting page of a GET command to a web server
post Loads the resulting page of a POST command to a web server
read Reads the value of a node in a HTML to a property

(Back to top)

assert task

This task is used just like NUnit Assert. It is used to make sure the returned page from your request contains was want you expected.

Parameters

Name Description Required
hasnottext The test fail if this text is found in the page false
hastext The test pass if this text is found in the page false
isquickerthan The test pass if the page is loaded in less than the milliseconde specified false
matchregex The test pass if the regular expression can find a match in the page false
message The message to return in case of failure false
test The test pass if this .NET expression is evaluated to true. This must be a valid VB.NET expression. false

Example

Here's a test that search for WebAccept with Google and fail if no result are returned.

<test name="search for webaccept"> <get url="http://www.google.com/search?q=webaccept" /> <assert hasnottext="did not match any documents" /> </test>

(Back to top)

post task

Use this tasks to request a web page using PORT method. With this task you can simulate entry into a web form.

Parameters

Name Description Required
param A parameter to be posted to the form true
name Name of the parameter true
value Value of the parameter true
url URL to the web form true

Example

Here's a test that post my name and e-mail to a php.

<test name="Search for test"> <post url="form1.php"> <param name="Name" value="Marc-André" /> <param name="Email" value="macournoyer@yahoo.ca" /> <param name="action" value="Post it" /> </post> <assert hastext="Marc-André" message="Should contain my name" /> <assert hastext="macournoyer@yahoo.ca" message="Should contain my e-mail" /> <assert hasnottext="Error" message="Should not return Error" /> <assert matchgegex="Marc-André.*macournoyer@yahoo.ca" message="My name should appear before the e-mail" /> <assert isquickerthan="1000" message="Page too slow to load" /> </test>

(Back to top)

echo task

This task echo text to the console. It is usefull for debugging your tests.

Parameters

Name Description Required
text The text to output true

Example

Here's a test that output Some text to the console.

<test name="Echo test"> <echo text="Some text" /> </test>

(Back to top)

read task

With this tasks you can retrieve values into web page using XPath expression and store it in a global parameter usable with ${parametername} in your tests.

Parameters

Name Description Required
into Name of the property to read the node into true
xpath XPath expression to the node to get the result from true

Example

Here's a test that retrieve the title of the page into the title parameter:

<test name="search for webaccept"> <get url="http://www.google.com/search?q=webaccept" /> <read xpath="html/head/title" into="title" /> </test>

(Back to top)

get task

Use this tasks to request a web page using GET method. GET request can be specified direcly in the URL like http://host.com/page.asp?param1=something

Parameters

Name Description Required
url URL to the web page true

Example

Here's a test that search for WebAccept with Google.

<test name="search for webaccept"> <get url="http://www.google.com/search?q=webaccept" /> </test>

(Back to top)

form task

This task replace the get and post tasks. It can be helpfull with test driven developement because when you've finish writing this task you can simply copy-paste it into your HTML page. Also it should be more easy to use for web developpers since it uses the same syntax as HTML forms.

Parameters

Name Description Required
input All the fields in your form, including one submit true

Example

Here's a test that output Some text to the console.

<test name="Post an HTML form"> <form action="?" method="post" name="f"> <input type="text" name="Field1" value="1" /> <input type="submit" name="action" value="Ok" /> </form> </test>