Skip to main content

WVD/Citrix Remote Desktop Automation using Computer Vision

Project description

Visual Sonar 🔊

Python 3.8+ License: MIT Version OCR Tests

Automate WVD/Citrix remote desktop sessions using Computer Vision — no DOM access, no server agents, no licensing fees.

Visual Sonar "echolocates" form fields by pressing TAB and detecting visual focus changes. Works where Selenium and traditional RPA tools can't.


✨ Features

Feature Description
🎯 Visual Field Detection Detects fields by screen diff when focus changes
📊 Data-Driven Testing Run same test with multiple data sets (CSV/JSON)
🔍 OCR Text Extraction Extract text from screen (pytesseract/easyocr)
🖥️ WVD Simulator Test safely without real remote desktop
🔒 Secrets Scrubbing Passwords never appear in logs
📸 Step Screenshots Every action captured for debugging
DPI Aware Per-monitor scaling support

🚀 Quick Start

Option A: Install from PyPI (Recommended)

pip install visual-sonar

Then use:

visual-sonar map
visual-sonar run
visual-sonar --help

Option B: Install from Source

git clone https://github.com/godhiraj-code/wvdautomation.git
cd wvdautomation
pip install -e .

2. Map Your Form

python visual_sonar.py map

Name fields as name:type (types: text, click, toggle, dropdown, double_click)

3. Create Input

{
    "username": "jdoe@company.com",
    "password": "SecretPass123",
    "signin": true
}

4. Run

python visual_sonar.py run

📋 Commands

Command Description
map Interactive field mapping
run [file.json] Execute automation
list Show available test cases
batch <data.csv> Data-driven batch testing
extract screen OCR extract from full screen
extract region x y w h OCR extract from region
help Show full help

🧪 Testing Without Remote Desktop

Use the built-in simulator:

# Terminal 1 - Start simulator
python wvd_simulator.py

# Terminal 2 - Map and run
python visual_sonar.py map
python visual_sonar.py run

📊 Data-Driven Testing

Run same test with multiple credentials:

Create test_cases/users.csv:

username,password,signin
user1@co.com,pass1,true
user2@co.com,pass2,true

Run batch:

python visual_sonar.py batch test_cases/users.csv

🔍 OCR Text Extraction

# Full screen
python visual_sonar.py extract screen

# Specific region
python visual_sonar.py extract region 100 200 300 50

# Verify text exists (for assertions)
python visual_sonar.py extract verify 100 200 300 50 "Success"

Note: Requires pip install pytesseract + Tesseract-OCR


🛡️ Safety

  • Emergency Stop: Move mouse to TOP-LEFT corner
  • FailSafe: Always enabled by default
  • Secrets: Never logged, always scrubbed
  • Screenshots: Captured on every step

📁 Files

File Purpose Git
wvd_map.json Field coordinates
input.json Your secrets
test_cases/ Test data files
*.png Debug screenshots

🔧 Troubleshooting

Issue Solution
"No map file" Run python visual_sonar.py map first
"Screen Unstable" WVD connection laggy, wait and retry
Wrong coordinates Remap (resolution/DPI may have changed)
OCR not working Install Tesseract-OCR software

📖 Documentation


📜 License

MIT © Visual Sonar Team

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

visual_sonar-1.0.1.tar.gz (20.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

visual_sonar-1.0.1-py3-none-any.whl (17.8 kB view details)

Uploaded Python 3

File details

Details for the file visual_sonar-1.0.1.tar.gz.

File metadata

  • Download URL: visual_sonar-1.0.1.tar.gz
  • Upload date:
  • Size: 20.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for visual_sonar-1.0.1.tar.gz
Algorithm Hash digest
SHA256 695eac34bac7c41bb5f596046f33ec61ec70e383276a4e8da3b2a07c27c8e16d
MD5 82e65d581be266307d516f424f9285e7
BLAKE2b-256 0fd1f18311f2aa289619464620e9a859fa1b742326a7141d975016ffb95cbc77

See more details on using hashes here.

File details

Details for the file visual_sonar-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: visual_sonar-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 17.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for visual_sonar-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 92f340ddd28a590376861f7b611658a7cdd02ecbcd163510e068c80f3765eb22
MD5 daa475d9e15ccbb299b38fb4de0b45bf
BLAKE2b-256 63f4b232d3c0846390427a18996c86aa96758c79697185f28cf08e0f1de8c2dc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page