Dear all,
we are trying to implement a „menu“ so that our testing personnel can choose where to start the test battery.
To do so, we thought of implementing something similar to this:
https://forums.millisecond.com/Topic23921.aspx#23934The basic logic should be that:
- For menu_choice 1 or 2, all scripts after the menu script are presented.
- For menu_choice 3, modul1 shall be skipped, but the rest be presented.
- For menu_choice 4, modul1 and modul2 shall be skipped, but the rest presented.
- For menu_choice 5, modul1, modul2, and modul3 shall be skipped, but the rest be presented.
- For menu_choice 6, no script after the menu shall be presented at all.
This is our batch:
<parameters>
/ vpcode_hd2 = 0
/ menu_choice = 0 //corresponds to test_sequence
</parameters>
<values>
/ vpcode_hd1 = 0
/ test_sequence = 0 //corresponds to menu_choice
</values>
<batch multigroup>
/ file = "vpcode.iqjs"
/ file = "pinguin_menu.iqjs"
/ file = "modul1.iqjs"
/ file = "modul2.iqjs"
/ file = "modul3.iqjs"
/ file = "modul4.iqjs"
/ onScriptEnd = {
if (batch.multigroup.currentScript == "vpcode.iqjs") {
parameters.vpcode_hd2 = values.vpcode_hd1;
}
if (batch.multigroup.currentScript == "pinguin_menu.iqjs") {
parameters.menu_choice = values.test_sequence;
}
}
</batch>
Depending on the menu_choice parameter, the respective scripts within our batch should be script.abort(false).
In modul1.iqjs, for example, the expt looks like this:
<expt myExpt>
/ onExptBegin = {
values.vpcode_hd1 = parameters.vpcode_hd2;
values.test_sequence = parameters.menu_choice;
if (parameters.menu_choice != 1 && parameters.menu_choice != 2) {
script.abort(false);
}
}
/ preInstructions = (myPage)
/ blocks = [1=myBlock]
</expt>
For modul2.iqjs it looks like this:
<expt myExpt>
/ onExptBegin = {
values.vpcode_hd1 = parameters.vpcode_hd2;
values.test_sequence = parameters.menu_choice;
if (parameters.menu_choice != 1 && parameters.menu_choice != 2 && parameters.menu_choice != 3) {
script.abort(false);
}
}
/ preInstructions = (myPage)
/ blocks = [1=myBlock]
</expt>
However, as soon as menu_choice exceeds a value of 2, none of the respective modules is shown.
What are we missing?
(The scripts are a mock-up and can be downloaded here:
https://tinyurl.com/iqtestmodul)Best,
pinguin