UiPath Screenplay Task – Testing Results, Findings, and Recommendations

Hello! I wanted to share my testing results, observations, and recommendations after experimenting with the UiPath Screenplay Task activity. My goal was to understand how prompt structure, DOM usage, and configuration choices impact performance, reliability, and scalability.

Scenario Overview

To test Screenplay, I built a simple GPU price-checker automation that:

  • Loops through three electronics retailers (Newegg, Micro Center, Amazon)
  • Searches for Radeon RX 7000 GPUs
  • Sorts by best/highest rated
  • Returns the top 2 non-sponsored results with:
    • Name
    • URL
    • Price
    • Rating

Automation Structure

  • A Main.xaml sequence reads a config file that defines the scenarios to run.
  • A switch statement selects one of five prompt variations per run.
  • The Screenplay Task activity is called inside a loop using the selected prompt.

This setup worked well as a lightweight testing framework and could easily be reused to benchmark other Screenplay scenarios.

Parameters Tested

Prompt Variations

I tested five prompt variations to evaluate:

  • Variable substitution vs. plain text
  • Explicit interaction constraints (keyboard vs. mouse)
  • The effect of allowing or disallowing product-page navigation
  • Using Custom Instructions vs. embedding everything directly in the prompt

Note:
I attempted to read prompts dynamically from the Config file, but Screenplay no longer replaced prompt variables (e.g., <[ProductLookup]>). While string replacement could work, I hard-coded prompts in XAML for this round of testing.

ID Prompt Summary Notes
1 Variables + explicit “avoid hotkeys, favor mouse clicks” + do not click listings Over-instructed
2 Variables + do not click listings :white_check_mark: Best overall
3 Plain-text, no variables Mixed results
4 Plain-text, allows clicking listings :cross_mark: Worst performer
5 Variables + “do not click listings” via Custom Instructions Strong, site-dependent

Screenplay Task Properties

Property Value Notes
Use DOM when available Config-driven Tested both on and off
Disable Variable Security True when Custom Instructions present Required for passing instructions
Type by Clipboard Whenever possible Significantly faster than key-by-key input
Model Screen Agent (Gemini 2.5 Flash) Other models showed similar behavior
Input Mode Chromium API Used as baseline; others not tested

Test Results Summary

:white_check_mark: Best Performing Prompt

Prompt 2 (variables + “do not click listings”, no hotkey instruction)
This was the best overall configuration across all three stores without DOM:

  • Newegg: 1.58 min
  • Micro Center: 0.89 min
  • Amazon: 3.98 min

The difference between Prompt 1 and Prompt 2 is subtle — removing the “avoid hotkeys / favor mouse clicks” instruction actually improves performance, likely by reducing reasoning overhead with no loss of reliability.

:cross_mark: Clear Failure Mode

Prompt 4 (allows clicking product listings) is the single biggest performance killer.

  • Newegg: 9.37 min
  • Amazon: significantly slower as well

Once the agent is allowed to open product pages, runtimes balloon dramatically. This test confirms that “Do not click any product listing” is a critical instruction and should always be included.

:balance_scale: Mixed Results

Prompt 3 (plain text, no variables)

  • Fastest Amazon run with DOM (2.06 min)
  • Poor performance on Newegg without DOM (3.90 min + partial output)

Variable substitution does not appear to harm performance and provides far better reuse, so there’s little motivation to use fully hard-coded text.

:puzzle_piece: Custom Instructions (Prompt 5)

Using Custom Instructions to inject “do not click listings” works very well:

  • Fastest Newegg run without DOM: 1.56 min
  • Strong Micro Center performance

However, on Amazon with DOM, it produced the slowest Amazon run (4.18 min). Amazon appears more sensitive to added reasoning paths introduced by Custom Instructions.

DOM Observations

  • Micro Center: DOM usage makes little difference
  • Amazon: DOM helps some prompts (P3, P4) but severely hurts others (P1, P2)
  • One data anomaly returned Micro Center URLs during an Amazon run, suggesting a browser context issue—its timing should be ignored

:white_check_mark: Best Overall Configuration

Prompt 2 + No DOM
Reliable, fastest average performance, and consistent across all three sites.

Screenplay Takeaways

:white_check_mark: What Screenplay Does Well

  • Handles net-new and unfamiliar systems with zero selector work
  • Self-corrects when UI structure changes instead of hard-failing
  • Produces clean, structured output when prompts are well designed
  • Ideal for attended or unattended automation and exploratory workflows where runtimes of 1–10 minutes are acceptable

:warning: Scalability Ceiling

Screenplay has a hard performance floor:

  • Each reasoning loop costs ~15–60 seconds of inference time
  • This latency compounds quickly
  • Three sites × one task totaled 15–18 minutes before tuning and 6-8 minutes after tuning.
  • A realistic enterprise process (10–20 steps) would be unworkable at scale, even after tuning.

This is not an implementation flaw—it’s the inherent cost of agentic execution.

Recommended Usage Pattern

Use Screenplay as a first-responder and fallback, not a primary execution engine.

Suggested pattern:

  • Route new or unknown systems through Screenplay
  • Collect runtime and stability data
  • Promote frequently-used systems to selector-based automations
  • Retain Screenplay as:
    • A discovery tool
    • A break/fallback path
    • A safety net when selectors fail

Screenplay shines by eliminating the barrier to first automation and by ensuring automations never “just stop working.”

Practical Usage Tips

1. Create a Testing Framework

  • Standardize prompt variants and DOM settings
  • Log execution time and output quality
  • Compare results to identify the best “recipe” per scenario

2. Keep Tasks Focused

  • Each Screenplay Task should have a single, well-defined outcome
  • Favor modular, composable tasks over end-to-end prompts

3. Prompt Engineering Matters

  • Over-instruction adds reasoning overhead
  • Too much freedom increases exploratory actions
  • Balance clarity with restraint

4. Use the HTML Trace Files!

The Trace Files output generates a detailed HTML report with:

  • Agent reasoning
  • Step-by-step actions
  • Screenshots

They are incredibly valuable, but dense. I fed them into another AI agent to extract tuning recommendations.

Example recommendations:

  • Extract ratings directly from search results pages
  • Only navigate to product pages as a last resort
  • For Newegg, click the search button instead of pressing Enter
  • Pre-navigate to “Highest Rated” URLs to eliminate sorting steps

5. Exception Handling

The ScreenPlay Task can fail to achieve its outcome, and may return an exception. Handle exception as needed for your use case.

Wishlist Feature

Screenplay would be dramatically more powerful if it learned over time.

Idea:

  • On first run, record resolved selectors (search bar, sort control, price field, etc.)
  • Cache them by domain and page structure
  • On subsequent runs:
    • Try cached selectors first
    • Fall back to AI reasoning only when they fail
    • Update the cache when changes are detected

This would preserve Screenplay’s self-healing nature while allowing it to converge toward native selector performance over time.

Conclusion

I’m excited to add Screenplay to my automation toolbox. Used correctly, it’s an excellent discovery engine and resilience layer—not because it’s fast, but because it can find its way through the unknown.

When implemented thoughtfully, Screenplay can make an entire RPA program more adaptive, maintainable, and future-proof.

hey @jking :waving_hand:

first of all, wow, what a great post! honestly, congratulations on your very thorough analysis, you’ve touched on so many crucial points.

that’s a great summary, I hope more and more people will discover this as they’ll start using ScreenPlay.

regarding this, a few points to make: although your conclusion holds, we do recommend optimizing UI automation workflows to be “maximally deterministic and minimally agentic”. for now, we don’t have a stable skill to guide a Coding Agent to do this for you, but you can still do it manually. take a good look at your UI steps and decide for yourself what really requires the agentic autonomy, adaptability and intelligence.

that being said, after optimizing the deterministic-agentic mix, we’re also very close to releasing a patch version that will unlock 3 new great models: our own Qwen-based fine-tuned model (a mini model that’s very fast and decently capable), Gemini 3.0 Flash Preview (also very fast) and GPT 5.5 - give our model + Gemini 3.0 Flash Preview a chance, the latency improvements are visible.

we’re also investigating some other architectural changes that might improve the latency even further, but I can’t make any promises for now - we’re aiming to have those by Oct in our 26.10 release.

that’s great advice - the execution traces are your closest friend when it comes to iterating on your ScreenPlay prompts. you’ll be very happy to learn that soon (again, can’t promise a specific date, but we want to release this asap) you’ll be able to iterate on the prompt by re-running the entire steps sequence (or specific steps, obviously) directly from the execution trace - it holds enough data so that you don’t need to have the target app live next to you. also, we’re going to expose this to Coding Agents so that they can iterate for you to optimize/stabilize your prompts. is that cool or what? :smiling_face_with_sunglasses:

thank you for sending this idea! yes, we’re actively pursuing a feature called “deterministic execution” which very much relates to what I was telling you above about the agentic-deterministic mix optimization. there are a few issue with what you proposed: recording resolved selectors would slow down the execution quite a bit, so this tells me it’s better to do this at design-time - ideally, you would populate an Object Repository with bullet-proof selectors build via Selector Intelligence (a skill that’s guiding Coding Agents to generate bullet-proof selectors using everything we know about them - this is part of the UIA CLI and its associated skills); also, the switch from agentic to deterministic and back has some associated technical issues: if something fails in one of the deterministic steps, we’re not sure about the state of variables or the UI itself, so the only way to fix this cleanly is to isolate every RPA activity into a workflow of its own - so that inputs and outputs are predictable; but this will slow everything down.

Sorry for doing this, but it’s easier for me to just copy-paste an official stance we have on this topic at the moment, starting from a similar question (to your idea) we got from one of our customers:

Q: Additionally, if the agent is expected to learn or adapt in real time, is that learning retained during the same bot run/iteration or across future runs, so the same fallback path is not rediscovered repeatedly increasing token consumption?

At this stage, ScreenPlay does not perform runtime learning or persist learned fallback paths, either within the same bot run or across future runs. Each time ScreenPlay encounters a UI problem, it reasons through it again from the current screen context and prompt, rather than reusing a memory of previously discovered fallback paths.
It is worth being upfront about the direction: ScreenPlay itself is intentionally agentic and is going to stay that way. We do not plan to turn ScreenPlay into a deterministic component. What we are investing in instead is making that agentic execution progressively more efficient and predictable, along two complementary tracks.
The first track is enriching ScreenPlay’s input. “Learnings” about a given UI, task, or environment will be accumulated into the ScreenPlay input itself - prompt, supporting docs, attached context, and so on - via tooling we are actively building. The goal is a more “informed” ScreenPlay that does not need to explore at runtime and instead goes straight to the target. The execution remains agentic, but with far less wasted reasoning and therefore meaningfully lower token consumption over time.
The second track is, when the user prefers no agentic behavior at all for a given step, generating a fully deterministic workflow using Coding Agents. We are also working on transformations in both directions between a ScreenPlay-based workflow and a deterministic one, so teams can shift the agentic/deterministic balance of a published workflow as their understanding of the target UI stabilizes.
On the broader question of mixing deterministic and agentic execution: the workflow as a whole can absolutely be a mix - and we very much want it to be. Most real-world automations will combine traditional, deterministic RPA for the predictable, high-volume parts of the process with ScreenPlay for the specific UI interactions where selectors are fragile or adaptive reasoning is genuinely required. ScreenPlay itself stays purely agentic; the deterministic/agentic mix lives at the workflow level.
We are still exploring how to make authoring that mix as easy as possible for developers - ideally with a skill or recipe that helps generate the right split automatically. We do not have a stable, opinionated solution there yet, but it is a clear direction. In the meantime, the recommended pattern is to compose the mix manually, using Coding Agents, CLIs and the work-in-progress UiPath Skills, or directly in Studio: deterministic RPA wherever the UI path is stable and well understood, and ScreenPlay only for the granular parts of the workflow where its agency and ability to adapt to UI variation are genuinely required. This keeps token consumption and agentic behavior constrained to the parts of the workflow where they add clear value, while preserving the reliability, observability and efficiency of traditional RPA for the rest.

I appreciate the reply @Bogdan_Sultana! I am excited for the new features you mentioned and will take all of this into consideration as we continue exploring Agentic automation!