Vidyano.Script
5.56.0
Prefix Reserved
See the version list below for details.
dotnet add package Vidyano.Script --version 5.56.0
NuGet\Install-Package Vidyano.Script -Version 5.56.0
<PackageReference Include="Vidyano.Script" Version="5.56.0" />
<PackageVersion Include="Vidyano.Script" Version="5.56.0" />
<PackageReference Include="Vidyano.Script" />
paket add Vidyano.Script --version 5.56.0
#r "nuget: Vidyano.Script, 5.56.0"
#:package Vidyano.Script@5.56.0
#addin nuget:?package=Vidyano.Script&version=5.56.0
#tool nuget:?package=Vidyano.Script&version=5.56.0
Vidyano.Script
Engine for the .visc Vidyano scripting format. Parses, interprets, and drives a real Vidyano.Client session against a backend — for tests, automation, agents, and reproducing customer flows from a small script file.
If you just want to run scripts from the command line, install the companion tool Vidyano.Script.Tool instead. This package is for embedding the engine in your own .NET process.
Installation
dotnet add package Vidyano.Script
Targets net8.0 and net10.0. Pulls in Vidyano.Core transitively.
Quick example
using Vidyano.Script;
var script = """
@app = "https://demo.vidyano.com/"
SIGN-IN admin / vidyano
OPEN MenuItem Home/Customers
SEARCH ""
EXPECT TotalItems >= 1
OPEN-ROW 0
EXPECT NavStack.Top.Kind = "PersistentObject"
""";
var result = await VidyanoScript.RunAsync(script);
Console.WriteLine($"{(result.Success ? "PASS" : "FAIL")}: " +
$"{result.Steps.Count} step(s), " +
$"{result.Diagnostics.Count} diagnostic(s)");
RunFileAsync(path) is the file-based equivalent. Lint(body) parses without executing and returns diagnostics only.
What's in a .visc?
A .visc script is a sequence of verbs that drive a Vidyano session, with EXPECT assertions checking observable state at each step. Verbs map 1:1 to user actions a frontend would perform:
SIGN-IN <user> / <password>— authenticate.OPEN MenuItem <path>— navigate to a query.OPEN-ROW <index>— drill into a row.SEARCH <text>— text-search the current query.EDIT/CANCEL/SAVE— standard PO edit lifecycle.SET <attribute> = <value>— change an attribute (incl. reference SET semantics).EXECUTE <action>— invoke an action by name.
Reserved @session variable
Client.Session is reachable as @session.<attr> in any position — SET target, value, EXPECT, {{…}} interpolation — without leaving the current nav frame:
SET @session.Patient = LOOKUP "Naam:Smith"
SET Year = @session.CurrentYear
EXPECT @session.Patient CONTAINS "Smith"
The names session, user, application are reserved; @session = … is a parse error. @user / @application parse but produce a runtime diagnostic until wired up.
EXPECT supports nav-stack state (NavStack.Depth, NavStack.Top.Kind, NavStack.Top.Name, NavStack.Top.IsDialog), query state (TotalItems, IsInEdit), notification state, and the ClientOperation queue:
EXPECT NavStack.Depth = 2
EXPECT NavStack.Top.Kind = "PersistentObject"
EXPECT IsInEdit = true
EXPECT ClientOperation ShowMessageBox
EXPECT ClientOperation ShowMessageBox CONTAINS "saved"
EXPECT ClientOperation Refresh IS NULL
EXPECT on metadata
EXPECT also reaches the round-tripped server metadata — Tag, Metadata, NavigationHints, and TypeHints — on attributes, the current PO, the current Query, and individual Query columns:
EXPECT Attribute FirstName TYPE = "String"
EXPECT Attribute FirstName TYPEHINT maxLength = "50"
EXPECT Attribute FirstName TAG IS NULL
EXPECT PO.Type = "Customer"
EXPECT PO.Metadata.brand = "vidyano"
EXPECT PO.NavigationHints.target = "Detail"
EXPECT Query.Name = "Customers"
EXPECT Query.PersistentObject.Type = "Customer"
EXPECT Query.Columns[FirstName].Label = "First name"
Missing bag keys produce null — assert with IS NULL / IS NOT NULL. The legacy EXPECT Query LABEL = "…" form still works.
TOOL — host-registered logic
TOOL <name> [k=v, …] [-> @var] calls a host-registered C# delegate. Use it for the bits that don't fit the verb grammar — DB lookups, startup/teardown snippets, environment probes — without embedding C# in the script:
options.Tools["lookup-customer"] = async (ctx, args, ct) =>
{
var email = (string?)args["email"];
var id = await myDb.FindCustomerIdAsync(email, ct);
ctx.Variables["lookupAt"] = DateTime.UtcNow.ToString("o");
return ScriptToolResult.Value(id);
};
TOOL warmup
TOOL lookup-customer email="alice@example.com" -> @cust
SEARCH "CustomerId:{{cust}}"
EXPECT TotalItems >= 1
Argument values participate in the regular expression grammar (literals, {{vars}}, @session.X reads). A throw becomes a tool-error diagnostic with the call site; cancellation flows through the host-supplied CancellationToken.
For CLI-driven runs, implement IVidyanoScriptToolPack and load the DLL with vidyano run … --tools <path.dll> — see the Vidyano.Script.Tool README for the plugin contract.
Modes
A @mode directive (or VidyanoScriptOptions.Mode) selects how strictly the engine guards observable state:
navigation(default) — verbs walk the UI the way a user would; nav-stack and dialog rules are enforced.audit— every observable side-effect is checked against the previous snapshot; useful for regression scripts.direct— guards relaxed; lets scripts poke state directly. Reserved for setup/teardown.
Programmatic options
var options = new VidyanoScriptOptions
{
RemoteUri = "https://localhost:44353/", // overrides script's @app
Mode = ScriptMode.Audit,
AcceptAnyServerCertificate = true, // dev certs only
Variables = { ["customerId"] = "abc-123" }, // pre-seed @vars
};
var result = await VidyanoScript.RunFileAsync("regression.visc", options);
License
MIT — see LICENSE.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Vidyano.Core (>= 5.56.0)
-
net8.0
- Vidyano.Core (>= 5.56.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 5.68.0 | 155 | 7/17/2026 |
| 5.67.0 | 387 | 6/30/2026 |
| 5.66.0 | 216 | 6/22/2026 |
| 5.65.0 | 530 | 6/17/2026 |
| 5.64.0 | 200 | 6/16/2026 |
| 5.63.0 | 135 | 6/15/2026 |
| 5.62.0 | 151 | 6/12/2026 |
| 5.61.0 | 237 | 6/4/2026 |
| 5.60.0 | 112 | 6/3/2026 |
| 5.59.0 | 115 | 5/29/2026 |
| 5.58.0 | 109 | 5/28/2026 |
| 5.57.1 | 105 | 5/27/2026 |
| 5.57.0 | 100 | 5/27/2026 |
| 5.56.0 | 101 | 5/26/2026 |