hi All
we have a script that is triggered from a button in a Visio.
is there a way we can automate through a script to trigger that script say 40 times using dummy data so we can accurately baseline performance?
I know it takes the human element out but has anyone seen or done this before?
thanks
ryan
Hi! Yes, you can automate repeated runs for a baseline. A wrapper automation script can call the existing script as a subscript 40 times, passing the required dummies and parameters each time. DataMiner’s Script action supports running another automation script and linking its dummies and parameters.
That would exercise the script itself, but it wouldn’t literally simulate clicking the Visio button. Make sure the test passes the same inputs and options the button supplies; the Visio link syntax is documented in Linking a shape to an Automation script.
You can also do it through C# if you are ok with that. Put a C# block in a wrapper automation script and call the Visio-triggered script as a synchronous subscript in a loop. This runs the script logic with supplied inputs, but does not simulate the Visio button click or its UI context.
<code class="dwa-code-block language-csharp">using System;
using System.Diagnostics;
using Skyline.DataMiner.Automation;
public class Script
{
public void Run(Engine engine)
{
string targetScript = "Your Visio script name";
for (int i = 1; i <= 40; i++)
{
var subscript = engine.PrepareSubScript(targetScript);
subscript.Synchronous = true;
// Replace these with the target script's actual input names and test values.
subscript.SelectScriptParam("InputName", "TestValue");
// If the script requires a dummy, link it to a test element:
// subscript.SelectDummy("DummyName", dmaId, elementId);
Stopwatch timer = Stopwatch.StartNew();
subscript.StartScript();
timer.Stop();
engine.Log("Run " + i + ": " + timer.ElapsedMilliseconds + " ms");
}
}
}</code>
The documented C# approach is to use PrepareSubScript, set its parameters or dummy links, and call StartScript; synchronous execution lets each run finish before the next begins (PrepareSubScript, StartScript).
Use safe test elements if the script performs sets or other actions. For a representative baseline, match the Visio button’s inputs and record the results outside the timed section if logging overhead matters.
Kind Regards.