Difference between test and test run
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2010
11:04 PM
05-03-2010
11:04 PM
Difference between test and test run
I have a little supporter tool, that resets my database. When the tool has finished its work it will show a message box. Now I dont't want to stop all tests, I want to stop only the test execution of one sub if the tool has a problem and does not show the message box. I've found Runner.Stop. But this does not seem to work. Here ist my litte demo programm:
Sub Main
TestA
TestB
End Sub
Sub TestA
MsgBox("A1")
Runner.Stop(true)
MsgBox("A2")
End Sub
Sub TestB
MsgBox("B")
End Sub
If I run this I would suppose that I get the messageboxes with A1 and than B. But I only get the A1. All subs are in different files.
So I did not understand the difference between test and testrun. Can you please explain this.
How can I implement my example above, so that I get the messages as supposed?
Sub Main
TestA
TestB
End Sub
Sub TestA
MsgBox("A1")
Runner.Stop(true)
MsgBox("A2")
End Sub
Sub TestB
MsgBox("B")
End Sub
If I run this I would suppose that I get the messageboxes with A1 and than B. But I only get the A1. All subs are in different files.
So I did not understand the difference between test and testrun. Can you please explain this.
How can I implement my example above, so that I get the messages as supposed?
2 REPLIES 2
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2010
08:51 PM
05-04-2010
08:51 PM
Hi Oliver,
The runner.stop(false) will stop the entire execution (as if you would click stop button), and runner.stop(true) will stop execution of the current test item ( not your sub procedure ).
So in your case you should just exit your procedure after first message box.
Sub Main
TestA
TestB
End Sub
Sub TestA
MsgBox("A1")
Exit Sub
MsgBox("A2")
End Sub
Sub TestB
MsgBox("B")
End Sub
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2010
10:53 PM
05-05-2010
10:53 PM
Hi Oliver,
So I did not understand the difference between test and testrun.
A 'test item' was meant by 'test'. During one test run, several test items can be executed.
How can I implement my example above, so that I get the messages as supposed?
You can assign the TestA and TestB routines from Pavel's post to individual test items and call Runner.Stop(True) when you need to stop the current test item without stopping the entire test run.
--
Dmitry Nikolaev
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Dmitry Nikolaev
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
