Metamation Developer Notes

  • Developer Notes
  • Resource Map
  • Tools
    • Code Formatting
    • Configuring Git
    • Assignments
    • Testing with Windows Sandbox
    • Single Binary Applications
    • Self-Updating Applications
  • Flux Workflow
    • Flux Workflow
    • Flux Development Style Guide
    • Release notes for Flux
    • SonarCloud analysis for Flux
    • Build a Flux SDK Program
    • Shipping Flux
    • Flux.Test
      • BasicBendAuto Test
      • LaserAuto.cs Detailed Documentation
      • Laserexample:Test1
  • Technical Notes
    • File formats
      • .FX File Format
      • Au(Gold) streams
      • .GEO File Format
      • .LST File Format
      • .LST file - technology
      • .BNC File Format
      • .WAD Files: Flux Resource Packages
      • .Curl Files: ASCII config information
    • Folders App
      • Data\Bendtools
      • Data\Machines
    • FluxCode
      • Welcome & Repo Map
      • Architecture & System Context
      • Subsystem *Bend* (Press Brake)
      • Subsystem *BCell* (Bend Cell Automation)
      • API Maps
      • Data Model Catalog
      • Design Patterns -- A Reader's Guide
      • Tests and Golden Paths
      • Guided Code Tours
      • CAM Glossary with Code Mapping
      • Assignments
      • Flux Onboarding Handbook
    • Data flow
      • Part
        • Part.Dwg
        • Part.Load
        • Part.Load to Part.Dwg
      • BendTech.cs
      • Bend Technology
      • Laser Cutting Technology
    • LTS (Long term support mechanism)
    • Machine ID Scheme
  • FluxTester
    • Commands and Scripts
    • Command Cookbook
    • Script Commands
    • BendTooling.cs Test Inventory
    • LaserTooling.cs Test Steps
    • Fluxtester Recipe Book
    • Nesting.cs Overview
    • Nesting.cs Recipe Book
    • Job.cs Overview
    • Job.cs Recipe Book
  • Software license
  • 3d party software
    • Python
  • Documentation
    • Bento documentation
      • Structure of a Bento page
      • Attributes
    • Software
      • Software Requirement
      • Installation
      • Git workflow for documentation contributors
    • Quick start guide
    • Workflow
      • Roles and responsibilities
      • Analyze
      • Edit
      • Proofread
      • Pre-Publish
      • Publish
      • Release cycle
      • Information required for Documentation Team
      • Checklist for Documenters
    • Styleguide
    • Flavoring
    • Translation
      • Ordering translation for a new document
    • Citations
    • Annotation
Tools
/
Testing with Windows Sandbox

Testing with Windows Sandbox

This document explains how to run UI test automation scripts in Windows Sandbox

Windows Sandbox

Windows Sandbox provides a lightweight desktop environment to safely run applications in isolation. Software installed inside the Windows Sandbox environment remains "sandboxed" and runs separately from the host machine. A sandbox is temporary. When it’s closed, all the software and files and the state are deleted. You get a brand-new instance of the sandbox every time you open the application. This makes 'Sandbox' ideal for use in Sanity/Smoke testing.

Prerequisites

  • ARM64 (for Windows 11, version 22H2 and later) or AMD64 architecture

  • Virtualization capabilities enabled in BIOS

  • At least 4 GB of RAM (8 GB recommended)

  • At least 1 GB of free disk space (SSD recommended)

  • At least two CPU cores (four cores with hyper-threading recommended)

Installation

Use the search bar on the task bar and type Turn Windows Features on or off to access the Windows Optional Features tool. Select Windows Sandbox and then OK. Restart the computer if you’re prompted.

If the Windows Sandbox option is unavailable, your computer doesn’t meet the requirements to run Windows Sandbox.

To enable Sandbox using PowerShell, open PowerShell as Administrator and run the following command:

Enable-WindowsOptionalFeature -FeatureName "Containers-DisposableClientVM" -All -Online

Locate and select Windows Sandbox on the Start menu to run it for the first time.

Windows Sandbox supports simple configuration files, which provide a minimal set of customization parameters for Sandbox. Windows Sandbox configuration files are formatted as XML and are associated with Sandbox via the .wsb file extension. An example wsb file is shown below. The below text can be saved to a file with .wsb extension which can be double clicked to open a sandbox instance with the specified configurations.

<Configuration>
  <Networking>Enable</Networking>
  <MappedFolders>
    <MappedFolder>
      <HostFolder>C:\Users\username\source\repos</HostFolder>
      <SandboxFolder>C:\Users\WDAGUtilityAccount\desktop\repos</SandboxFolder>
      <ReadOnly>false</ReadOnly>
    </MappedFolder>
	<MappedFolder>
      <HostFolder>C:\mm\sandbox</HostFolder>
      <SandboxFolder>C:\mm\sandbox</SandboxFolder>
      <ReadOnly>false</ReadOnly>
    </MappedFolder>
  </MappedFolders>
  <LogonCommand>
  <Command>c:\mm\sandbox\startup.bat</Command>
  </LogonCommand>
</Configuration>

Folders on the host machine can be mapped to the specified path on the sandbox so that files in the host machines can be accessed inside the sandbox.

Logon commands are executed after the sandbox is started. We can use batch (.bat) or powershell scripts to perform actions after the sandbox is started. An example batch file is given below.

Note: The batch file should be accessible from inside the sandbox for it to be executed. In the example xml file, the batch file location on the host ("c:\mm\sandbox") has been mapped to the sandbox.

REM FluxTester prerequisites
md c:\mm\bin
c:\mm\sandbox\dotnet7.exe /quiet
REM Set LicenseServer to SYS546 or its current IP address in the TMM network
md c:\programdata\metamation\flux\recent
echo [Basic] > c:\programdata\metamation\flux\recent\notes.ini
echo LicenseServer=192.168.1.183 >> c:\programdata\metamation\flux\recent\notes.ini
REM Run Flux setup file without any prompts
c:\mm\sandbox\setup.Flux.545.exe /SP- /SILENT

Note: REM indicates a comment in the batch file

A screen recording of starting a new sandbox instance and running some automated tests can be found here.

Notes

Flux and other application require OpenGL to work correctly. There are a couple of requirements to enable this in Windows sandbox.

  1. Hardware access inside virtualization (Intel VT-d for Intel PCs) should be enabled in bios

  2. Above 4G Decoding should also be enabled in bios if available

  3. If running on a laptop with both integrated and discrete gpus, make sure Windows Sandbox application is using the discrete gpu. Also set power profile setting to high performance if running on battery.

Eg: In a Laptop with Intel and NVidia GPUs, set preferred gpu in NVidia control panel as shown below

Wrapping Settings

The license server running in SYS546 has limited seats available. Check if free seats are available before running tests.

Contents

  • Windows Sandbox
  • Prerequisites
  • Installation
  • Notes
Assignments Single Binary Applications

      Copyright © 2025 TRUMPF Metamation. All rights reserved.

    Compiled by Bento