Urgent.News

What's breaking now, across hundreds of outlets.

Tech

From sleep(5000) to a real UI check: five tests for desktop automation

A desktop automation can pass in a demo and still fail on a real workstation. Fixed delays, small layout changes, and retries that repeat the wrong action are common reasons. Before shipping a flow, test the situations that prove it can stop safely. 1. The normal screen Run the flow when the expected window and control are already visible. Confirm that it recognizes the right app and takes only…

Desktop automation can seem foolproof when tested in a demo, yet stumble when executed on actual hardware. Delayed actions, minor UI alterations, and repeated wrong moves are typical culprits. Before releasing a flow, it's crucial to test scenarios that ensure safe termination.

Firstly, run the flow when the expected window and control are already visible. Verify it correctly identifies the application and performs the intended action. If multiple similar windows can be open, specify the target precisely.

Secondly, introduce artificial delays to mimic slower machines. Avoid fixed sleeps that might end prematurely. Wait for observable events like a button becoming enabled or a status change. Set a deadline to prevent the workflow from hanging indefinitely.

Thirdly, render the target unavailable. The flow should report "not found" or trigger a review path instead of clicking a nearby control out of frustration. This failure scenario should be treated with the same rigor as the successful one.

Fourthly, alter the window size, display scaling, or switch themes. Accessibility identifiers and text may prove more stable than pixel positions when the app provides them. Image matching can be helpful, but test its boundaries across supported environments.

Lastly, abruptly interrupt actions or remove expected confirmations. Before retrying, verify if the initial attempt altered the application. Otherwise, a second click might submit a form twice, create a duplicate, or update the incorrect item. For every risky step, ask three questions: What evidence confirms it's safe to proceed?

What happens if that evidence is absent by the deadline? How will the flow determine the action succeeded? Use test data and keep consequential decisions reviewable. Desktop interfaces evolve, visual matches can be ambiguous, and a passing test doesn't guarantee every future layout will behave identically. Tools like Macro8n, a local-first visual workflow editor for desktop automation, make it easier to show both "found" and "not found" outcomes before the flow reaches real work.

The principle of testing failure paths before trusting the success path applies to any automation stack. Reflect on which failure case has previously tripped up your desktop workflow in production.

Rewritten by urgent.news; may contain errors — check the original.

Read the original at dev.to →

Report a problem with this story

More in Tech

Why Strong SREs & Backend Engineers Struggle in Meta Production Engineering Interviews (5 Advanced Technical Traps)

Most experienced SREs, DevOps engineers, Systems Engineers, and Backend SWEs do not struggle in Meta Production Engineering (PE) interviews because they lack real-world experience.

  • Parsing process info from /proc/[pid]/stat and handling JSON telemetry in Python can be tricky
  • Guard against Boolean values and non-finite floats when validating JSON telemetry in Python

My shell-injection scanner flagged 3 of my own files. All 3 were wrong.

My shell-injection scanner flagged 3 of my own files. All 3 were wrong. I built a small static checker called sg audit . It finds the three call shapes that turn untrusted text into shell syntax…

  • Scanner flagged three files as vulnerable in its own source tree
  • Three flagged findings were actual vulnerabilities
  • Author suggests fixes to reduce false positives

Logistics Renewal Deadlines: When Should Failed Webhook Jobs Use a Delayed Queue or Cron?

Short answer: use a delayed queue when each failed webhook job needs its own retry time and audit trail; use cron to run a bounded redrive or reconciliation sweep when a little extra latency is…

  • Use delayed queue when each failed webhook job needs unique retry time and audit trail.
  • Cron schedule is suitable for bounded redrives, dead-letter reviews, or reconciliation passes.
  • Choose based on latency tolerance and need for individual retry time and audit trail.

More from Sunday 22 November →