How to skip test cases when they are meaningless?

125 views
Skip to first unread message

Richard Sachsse

unread,
Aug 7, 2013, 12:37:46 AM8/7/13
to webi...@googlegroups.com
Dear WebInjectors,

Let's consider a sequence of test cases.

Test case id="1" checks for the presence of a given string (verifypositive) and parses some data  (parseresponse, parseresponse1) for use in the following test cases.

If verifypositive is true, let's do the next 3 test cases (id="2", id="3", id="4"), using the previously grabbed data (parseresult, parseresult1).

But else
, if verifypositive is false, these 3 tests cases are meaningless, so they should be skipped. At least, no HTTP request should be issued (since it would most probably fail), and each pointless test case should be marked as PASSED (as they did not failed).

As an example, consider an auction web app. If there is an auction running, let's test bidding! If webinject tests fail, send an alert. Conversely, if there's no auction running at the moment, there's nothing to be tested nor to be notified.

Can webinject 1.78 run such conditional test cases?

Thanks,
richard


Richard Sachsse

unread,
Aug 7, 2013, 10:14:52 PM8/7/13
to webi...@googlegroups.com
In addition to previous message, if webinject really cannot handle this kind of testing, please consider the following suggestion for a new parameter to enable simple conditional testing.

In the first test case, parseresponse could be used to grab the auction info. In the following test cases, we can recall its value by the variable {parseresult}. Thus, we'd have to check in the conditional test cases whether this variable represents a running auction. I suppose we'd have to introduce a new parameter (function) to compare two values: {parseresult} and the expected value for "no running auction". It could be named skiptestpositive. If the values match, webinject would mark the current test case as PASSED and skip to the next test case.

If someone takes the challenge, I'd be happy to help with testing.

richard

vincent palluel

unread,
Aug 26, 2013, 7:53:57 AM8/26/13
to webi...@googlegroups.com
Hi,

As a response for your first message I would recommand the use of the break_on_errors directive.

$man webinject

break_on_errors
          stop after the first testcase fails, otherwise Webinject would go on and execute all tests regardless of the previous case.

Though the pointless cases won't be marked as passed as they will not be executed.
Note that all the tests of your first case will be executed as there is no conditional relation between them. This bring us to your second message on which i would respond that many things could be done to improve Webinject :)


 Regards



2013/8/8 Richard Sachsse <richard...@gmail.com>

--
You received this message because you are subscribed to the Google Groups "WebInject" group.
To unsubscribe from this group and stop receiving emails from it, send an email to webinject+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

vincent palluel

unread,
Aug 26, 2013, 8:15:24 AM8/26/13
to webi...@googlegroups.com
Given that Webinject isn't anymore under heavy development maybe it could be forked


2013/8/26 vincent palluel <vincent...@gmail.com>

Sven Nierlein

unread,
Aug 26, 2013, 8:18:45 AM8/26/13
to webi...@googlegroups.com, vincent palluel
On 26.08.2013 14:15, vincent palluel wrote:
> Given that Webinject isn't anymore under heavy development maybe it could be forked
>

You are welcome to send patches or to fork it on github: https://github.com/sni/Webinject

Sven
Reply all
Reply to author
Forward
0 new messages