How to design test script in some cases?
I have often faced difficulty in designing test script, because unlike coding, there is no clear cut plain and simple logic in designing test scripts, nor there is a universal standard way of doing the same. Even if there is, I assume there would be a context in which it will clearly just not work!
One specific problem I wanted to discuss was this one:-
Suppose I have to design a test script for a module, which itself is a long process consisting of multiple screens, in each screen in which you can provide input (or configure them, in other words) as to what will be the end result of that process. So, there are a lot of permutations and combinations in play here. You get output to test anything, only at the end of that process.
Now, in such a situation, how do I design the test script? It definitely makes sense to test all/maximum number of test cases in a single execution of this process. Since each input or configured screen, has its way of affecting the output, it is relatively easy to isolate the failing test cases, just by seeing the output, obviously only if there is some output to test - if it's a total failure, we may require to run the whole process many times to isolate the test case which is the cause of failure.
In the above case, how do I manage the test case numbering? I am giving inputs in different screens for different test cases, but I am getting the output - to be checked against the expected results, for all of them in a single final step. So here, it's not that I can isolate the pair of action (steps to be taken) and expected results, for each test case! Maybe the actions are different but expected results merge at one final step.
And then, how do I design it for the possibility that it might be giving no output for the above-mentioned test execution for many test cases simultaneously. I how do I isolate the failing test case in such a situation? If I simply refine it, the script and the execution time will become unnecessarily lengthy - since it will mean executing the entire process for each test case or each set of 3-5 test cases. How should I choose between simplicity of test script and the execution time/script length?
One (ptobably not the best and suitable not for every case) possibility is to use varibales during the test execution.
A test scenario consists of two input screens where I have to test the presence of certain elements (title, logo, some text etc. I run the test scenario until the end (output screen) and during execution I set suite variables (e.g.
Falsedepending on presence of the corresponding elements.
This was in a way the main test. After that there are subtests which consist only of evaluating of those variables: if
Truethen set test "Check Logo Visibility" to Passed, etc.
In this you have only one test execution but can test several isolated things.