✏️ AIT402 RPA Smart Notebook
First Internal · VIIIth Sem · MITS Kochi · January 2026 | Total: 50 Marks
0 of 14 questions studied
0
Studied
14
Questions
0%
Complete
🎯 Tip: Mark ✓ after you study each question. Your progress is saved automatically!
📝 Part A 3 Marks Each · Answer All
✓ STUDIED
Q1
Banking bot — RPA vs Traditional Automation. Identify the approach and support with 3 key differences.
CO1 3 Marks
🏦 Scenario: A banking bot mimics human clicks and typing across multiple applications.
✍️ Answer — This is RPA
The bot mimics human actions (clicks & typing) across multiple applications without API — this is the defining feature of RPA.
📊 RPA vs Traditional Automation — 3 Key Differences
Aspect🤖 RPA⚙️ Traditional Automation
Interaction LevelWorks at the UI layer — mimics clicks, typing, mouse movements like a humanWorks via APIs, database connections, or code integration — direct system access
Technical RequirementNo coding required; non-technical users can record steps using a recorderRequires developers to write scripts and deep knowledge of the target system
FlexibilityCan automate any application visible on screen, even legacy systems, without modifying themOnly works if the system has an exposed API or the source code is accessible
🤖 RPA Bot Mimics human clicks UI layer interaction No code needed Banking App CRM System Email Client ⚙️ Traditional API / DB integration Needs source code Developer required
✓ STUDIED
Q2
Recommend suitable RPA platforms for BFSI, Healthcare, and Retail domains needing global scalability and centralized control.
CO1 3 Marks
✍️ Answer — Platform Recommendations
  • 1.BFSI (Banking, Financial Services, Insurance) → Automation Anywhere: Over 50% of its revenue comes from BFSI. It offers cloud-native bots, handles both structured and unstructured data, and provides a centralized command system (Control Room) for managing hundreds of bots globally. Key clients include JP Morgan Chase, Deloitte, AT&T.
  • 2.Healthcare → UiPath: UiPath's Orchestrator provides centralized management of attended and unattended robots, crucial for hospitals managing patient scheduling, billing, and claim processing. Its scalable platform is used by AXA and Cognizant across healthcare workflows.
  • 3.Retail → Blue Prism: Blue Prism is designed for enterprises needing scalable, configurable, and centrally managed automation. Revenue includes retail and consumer sectors. It provides audit trails and compliance, important for large retail operations across multiple regions.
PlatformDomain Best FitKey CharacteristicClients
Automation AnywhereBFSIML + NLP, cloud-native, 50%+ BFSI revenueJP Morgan, Deloitte
UiPathHealthcareOrchestrator for centralized control, attended/unattended robotsAXA, BBC, SAP
Blue PrismRetailScalable, centrally managed, sold via partnersBNY Mellon, Telefonica
✓ STUDIED
Q3
Assertion-Reason: Attended Robot cannot be triggered by a mouse click/keypress. Reason: Attended Robots run on server, triggered by Orchestrator schedule only. MCQ
CO1 3 Marks
✍️ Answer — Option (D): Assertion is FALSE, Reason is TRUE
  • AAssertion (A) is FALSE: Attended Robots CAN be triggered by user events like mouse clicks and key presses. According to the notes — "Attended Robot operates on the same workstation as a human, usually triggered by user events." This is their defining characteristic.
  • RReason (R) is TRUE (but partially misleading): Attended Robots run on a separate server describes Unattended Robots, not Attended. However, Orchestrator can schedule and trigger Unattended Robots. The Reason statement is True in that Orchestrator schedules apply to Unattended Robots. So R is true when interpreted for Unattended context.
  • Correct Option → (D): Assertion (A) is False, but Reason (R) is True. A is false because Attended Robots ARE triggered by user events. R is true because Unattended Robots (not Attended) run on servers and are scheduled by Orchestrator.
🤖 Attended vs Unattended Robot — Quick Reference
Attended Robot (Front Office Robot): ├── Works on SAME workstation as human ├── Triggered by USER EVENTS (clicks, key presses) ← This is the key ├── Cannot start from Orchestrator └── Cannot run under locked screen Unattended Robot (Back Office Robot): ├── Runs on SEPARATE SERVER or virtual environment ├── Triggered by ORCHESTRATOR SCHEDULE ← This is what Reason describes ├── Handles remote execution, monitoring └── Works without human interaction
✓ STUDIED
Q4
Step-by-step procedure to add and configure the Delay activity in a UiPath workflow (type, Submit, wait 10s, click Close).
CO2 3 Marks
🖥️ Scenario: Robot types into a field → clicks "Submit" → waits exactly 10 seconds → clicks "Close"
✍️ Answer — Step-by-Step Delay Configuration
  • 1.Open UiPath Studio and create or open an existing Sequence workflow project.
  • 2.Add the Type Into activity: From Activities panel, drag "Type Into" to the Designer. Configure it to type text into the target field. This records the data-entry step.
  • 3.Add Click activity for "Submit": Drag a "Click" activity after Type Into. Use the Indicate on Screen option to point at the Submit button. UiPath captures its selector automatically.
  • 4.Add the Delay activity: In the Activities panel, search for "Delay". Drag it into the workflow AFTER the Click (Submit) activity and BEFORE the next Click (Close) activity.
  • 5.Configure the Delay: In the Properties panel (right side), set the Duration property to 00:00:10 (hh:mm:ss format) — this means 10 seconds. Alternatively enter TimeSpan.FromSeconds(10) in the Duration field.
  • 6.Add Click activity for "Close": Drag another Click activity after the Delay. Indicate the Close button on screen to capture its selector.
📋 Workflow Sequence Diagram
[START] │ ▼ ┌─────────────────┐ │ Type Into │ ← Types data into field │ (Field) │ └────────┬────────┘ │ ▼ ┌─────────────────┐ │ Click │ ← Clicks "Submit" button │ (Submit Btn) │ └────────┬────────┘ │ ▼ ┌─────────────────┐ │ Delay │ ← Duration: 00:00:10 ← KEY STEP │ 10 seconds │ └────────┬────────┘ │ ▼ ┌─────────────────┐ │ Click │ ← Clicks "Close" button │ (Close Btn) │ └─────────────────┘ │ [END]
✓ STUDIED
Q5
Develop an RPA program using UiPath to build a Data Table with Student_Name (String), Roll_No (Int32), Class (String). Insert data and iterate to display rows.
CO2 3 Marks
✍️ Answer — UiPath Data Table Program
  • 1.Build Data Table Activity: Drag "Build Data Table" from Activities panel. Click "Data Table…" to open the wizard. Add columns: Student_Name (String), Roll_No (Int32), Class (String). Store output in a variable dtStudents of type DataTable.
  • 2.Add Data Row Activities: Use "Add Data Row" activity three times. Set ArrayRow property to: {"Alice", 1, "B.Tech"}, {"Bob", 2, "MCA"}, {"Carol", 3, "B.Tech"}. Each row populates the data table.
  • 3.For Each Row Activity: Drag "For Each Row" and set the DataTable to dtStudents. Inside the loop body, use a "Write Line" (or Message Box) activity with the expression: row("Student_Name").ToString + " | " + row("Roll_No").ToString + " | " + row("Class").ToString
🔄 Program Flow
Build Data Table (dtStudents) Columns: Student_Name|String, Roll_No|Int32, Class|String Add Data Row → {"Alice", 1, "B.Tech"} Add Data Row → {"Bob", 2, "MCA" } Add Data Row → {"Carol", 3, "B.Tech"} For Each Row (row In dtStudents) └── Write Line: row("Student_Name") + " | " + row("Roll_No") + " | " + row("Class") OUTPUT PANEL: ► Alice | 1 | B.Tech ► Bob | 2 | MCA ► Carol | 3 | B.Tech
✓ STUDIED
Q6
Design a UiPath workflow using the Switch activity to categorize students into Houses based on ID ending (1=Red, 2=Blue, 3=Green, else=Guest).
CO2 3 Marks
✍️ Answer — Switch Activity Workflow
  • 1.Set up Variables: Create variable studentID (Int32) — store the student's ID. Create house (String) — to store result. Use Input Dialog activity to get the student ID from user.
  • 2.Add Switch Activity: Drag "Switch" activity onto the canvas. Set the TypeArgument to Int32. Set the Expression to: studentID Mod 10 (this extracts the last digit of the ID).
  • 3.Add Cases: Click "Add Case" for each: Case 1 → Assign: house = "Red House" | Case 2 → Assign: house = "Blue House" | Case 3 → Assign: house = "Green House" | Default → Assign: house = "Guest House"
  • 4.Display Result: After the Switch activity, add a Message Box activity with: "Student assigned to: " + house
🏠 Switch Activity — Decision Tree
[Input Dialog] → studentID = 12 Switch (studentID Mod 10) ├── Case 1 → house = "Red House" ├── Case 2 → house = "Blue House" ├── Case 3 → house = "Green House" └── Default → house = "Guest House" [Message Box] → "Student assigned to: Blue House" (Because 12 mod 10 = 2 → Blue House ✓)
📚 Part B 8 Marks Each · Choose Optional Sets
✓ STUDIED
7a
Identify the specific Core Component of RPA used in each of 3 ZoomCorp invoice bot scenarios and justify.
CO1 8 Marks
🏢 ZoomCorp: (1) Mouse tracking to generate script → (2) Enabling Japanese text reading → (3) IT Manager schedules bot via central dashboard every Friday 5 PM
✍️ Answer — Core RPA Components Identified
  • 1.Scenario 1 → RECORDER: The developer clicks through the process while software tracks mouse movements to generate the initial script. This is the Recorder component — "It records mouse and keyboard movements on the UI and this recording can be replayed to do the same steps again and again." The recorder enables rapid automation without programming.
  • 2.Scenario 2 → PLUGIN / EXTENSION: Enabling the bot to read Japanese text requires an OCR (Optical Character Recognition) plugin or a language extension. Plugins extend the functionality of development studios — "Plugins can provide specialized activities that are not available in the core activity library, such as advanced OCR." For Japanese text: Google OCR or Microsoft OCR engine plugin is used.
  • 3.Scenario 3 → CONTROL CENTER (Orchestrator): The IT Manager uses a central dashboard to schedule the bot every Friday at 5 PM. The Control Center (UiPath Orchestrator) allows scheduling: "It can be used to start/stop Robots, make schedules for them, maintain and publish code, redeploy Robots to different tasks, and manage licenses." This is centralized management of bot execution.
📹 Recorder Tracks mouse & keyboard Generates script from human demonstration Scenario 1 ✓ 🔌 Plugin/Extension Adds specialized capabilities: OCR, language support Scenario 2 ✓ 🎛️ Control Center Schedule, deploy, monitor bots from central dashboard Scenario 3 ✓
  • 4.Development Studio (additional component): Used to create and code the entire invoice processing bot — "The development studio is used by developers to create Robot configuration using drag-and-drop visual workflows."
  • 5.Bot Runner: The machine that actually executes the developed bot. After scheduling in Control Center, the Bot Runner carries out the physical execution on Friday at 5 PM.
  • 6.Integration: All 5 core components (Recorder, Dev Studio, Plugin, Bot Runner, Control Center) work together to form a complete RPA solution. None can function optimally in isolation.
  • 7.Rapid Automation Benefit: The Recorder's ability to capture steps without coding drastically reduces development time — this is "one of the biggest reasons for RPA's popularity."
  • 8.Scalability via Control Center: Multiple bots can be scheduled and managed centrally, enabling ZoomCorp to scale invoice processing across departments without manual intervention.
✓ STUDIED
7b
Illustrate the types of recordings in UiPath and select the most appropriate recorder for each given case (Desktop, Web, Citrix, Simple desktop task).
CO1 8 Marks
✍️ Answer — Types of Recordings in UiPath
  • 1.Basic Recorder: Used to record activities on the desktop for single activities and simple workflows. Actions are self-contained and not wrapped in separate windows. Best for: standalone desktop automation with a single focused action. → Case 4: Simple, single-step desktop task
  • 2.Desktop Recorder: Used to record multiple actions and complex desktop workflows. Each activity is contained inside an "Attach Window" component, which ensures the correct window is targeted even when multiple windows of the same app are open. → Case 1: Standalone desktop application with multiple steps
  • 3.Web Recorder: Used to record actions on web applications and browsers. Includes an "Open Browser" option to handle browser-based steps. Supports automatic recording of form fills, button clicks, and navigation. → Case 2: Submitting forms in a web-based system
  • 4.Citrix Recorder: Used to record virtual machines, VNC, and Citrix environments. Works with keyboard, text, and image-based automation only. Cannot record right-click, double-click, or keyboard shortcuts. Uses image recognition. → Case 3: Performing actions inside a virtual/Citrix environment
🖥️ Basic Single activities Simple workflows Self-contained No Attach Window → Simple task 🖥️ Desktop Multi-step actions Complex workflows Attach Window Prevents mis-clicks → Desktop App 🌐 Web Web browsers Forms & navigation Open Browser URL recording → Web Forms 🖥️ Citrix Virtual/VNC env Image recognition Text & keyboard No right-click → Citrix/VNC
  • 5.Automatic Recording Mode: Records multiple actions in one go by clicking the Record icon. Cannot record hotkeys, right-clicks, or double-clicks. Best for building a foundation script rapidly.
  • 6.Manual Recording Mode: Records one step at a time. Supports all actions including hotkeys, right-click, mouse hover, and modifier keys (Ctrl, Alt). Offers more control and precision.
  • 7.Element, Text, Image: Three additional options in the recording panel for targeting specific UI parts — Element for clicking UI objects, Text for scraping text, Image for image-based recognition especially in Citrix.
  • 8.Why Recorder = RPA's Success: "The task recorder is the main reason for RPA's success." It allows non-technical users to automate processes without writing code, making RPA accessible to business users.
— OR —
✓ STUDIED
8a
Propose optimal Workflow types for Solution X (fixed-order migration) and Solution Y (dynamic loan with loop) — Unidirectional vs Conditional Branching.
CO1 8 Marks
Solution X: High-volume legacy migration, records from Source A → Target B in fixed order, no deviation. | Solution Y: Dynamic loan underwriting with risk-tier paths and a loop for 'borderline' applications.
✍️ Answer
  • 1.Solution X → SEQUENCE Workflow: A Sequence represents "a linear sequence of activities that execute one after another." Since Solution X involves a fixed, non-deviating order (Source A → Target B), no branching or decision-making is needed. Sequences are "ideal for simple automations with a well-defined set of steps" and "suitable for linear processes."
  • 2.Justification for Sequence (X): Unidirectional flow = one path, no conditions. Sequence enforces this structurally — it cannot branch. This makes debugging easier and the code transparent. Changing any step won't accidentally create alternative paths.
  • 3.Solution Y → FLOWCHART Workflow: A Flowchart "presents multiple branching logical operators, that enable you to create complex business processes." Solution Y needs distinct processing paths based on risk tiers (high, medium, borderline) and a loop for borderline cases — only Flowcharts support this naturally.
  • 4.Justification for Flowchart (Y): The borderline re-evaluation loop is a While-like condition: "Flowcharts offer more flexibility compared to Sequences. They allow you to define conditional logic using If statements and loops (While, For Each)." This enables the loan bot to cycle applications back into the holding queue.
FeatureSequence (Sol. X)Flowchart (Sol. Y)
Flow typeLinear, top-to-bottomMulti-branch, conditional
Decision makingNone requiredRisk-tier branching
LoopsNot neededBorderline re-evaluation loop
ComplexitySimple, easy to debugComplex, visual overview
UiPath Use CaseData migration, ETL tasksLoan approval, order processing
  • 5.State Machine (optional for Y): If the loan process has distinct named stages ("Received", "Under Review", "Approved", "Rejected", "On Hold"), a State Machine could also work — it manages "complex workflows with multiple states and transitions."
  • 6.Structural Efficiency: Sequences are "single block activities" — they act as reusable modules inside larger Flowcharts. In Solution Y, individual processing steps (e.g., credit check) can be Sequences nested within the Flowchart.
  • 7.Disadvantage of wrong choice: Using a Flowchart for Solution X adds unnecessary complexity. Using a Sequence for Solution Y makes the loop and branching impossible to implement cleanly — leading to unmaintainable, error-prone code.
  • 8.Debugging implications: "Sequences are the smallest type of project, suitable for linear processes as they enable you to go from one activity to another seamlessly." For auditing fixed-order migrations, sequences produce clear, step-by-step execution logs.
✓ STUDIED
8b
Propose data extraction approaches for System A (web UI with hidden data) and System B (virtualized image-rendered invoices) and justify.
CO1 8 Marks
System A: Web interface, selected fields visible, additional reference data embedded in HTML but not displayed. | System B: Virtualized environment rendering scanned invoices as images — no text/application controls.
✍️ Answer
  • 1.System A → FullText Method: The FullText method "reads text from all layers, including non-visible layers (e.g., text behind dropdowns or hidden containers)." System A has reference data embedded in the HTML but not rendered visibly — FullText extracts ALL text including hidden elements, making it ideal.
  • 2.Why not Native for System A?: Native method "only works with apps that are built to render text with the Graphics Device Interface (GDI)" — web browsers use HTML rendering, not GDI. Also, Native cannot access hidden fields easily. FullText is more reliable for structured web scraping.
  • 3.System B → OCR Method: Since invoices are rendered as images in a virtualized environment with "no underlying text or application controls," OCR is the only viable approach. "OCR is preferred when the other two fail to extract data" and "works with all applications including Citrix." It interprets pixel patterns to recognize text.
  • 4.OCR Engine Selection for System B: For scanned invoice images, Tesseract OCR (open-source, multi-language) or Google OCR (high accuracy, wide font support) would be used. "Requires good image resolution and contrast for accurate results."
CriteriaSystem A → FullTextSystem B → OCR
Data formatHTML (visible + hidden)Image (scanned invoice)
MethodScreen Scraping (FullText)OCR engine
Hidden data✓ Can extractN/A (all pixels)
SpeedFast, highly accurateSlower, ~95% accurate
Virtual environmentStandard browserCitrix/RDP ✓
  • 5.FullText Advantage: "Highly accurate for applications where all text (including hidden text) is required. Faster and more reliable compared to OCR. Suitable for both foreground and background automation."
  • 6.OCR Limitation Mitigation: To improve System B accuracy, apply image preprocessing — "contrast enhancement or noise reduction" — before running OCR. Also combine with anchor elements to improve reliability in dynamic UIs.
  • 7.Why not Native for System B?: Native "might not work effectively on web-based or virtualized environments (e.g., Citrix)." System B is explicitly virtualized — Native cannot access underlying text since it's rendered as image pixels.
  • 8.UiPath Activities Used: For System A — "Screen Scraping Wizard with FullText option enabled." For System B — "Read Text with OCR" or "Screen Scraping Wizard with OCR enabled" or "Digitize Document" for document understanding workflows.
— OR —
✓ STUDIED
9a
Design a UiPath workflow that uses an integer array (SalesArray) of 50 daily sales figures to automatically identify and print the highest sales figure.
CO2 8 Marks
✍️ Answer — SalesArray Max Finder Workflow
  • 1.Variable Declaration: Create variable SalesArray of type Int32[] (array of integers). Initialize with 50 sample values in Default value field: {1200, 3400, 2100, ..., 5600}. Create maxSales (Int32) initialized to Integer.MinValue or 0.
  • 2.Assign Activity — Initialize: Use Assign: maxSales = SalesArray(0) to set the initial max to the first element. This ensures comparison works regardless of the values in the array.
  • 3.For Each Activity: Drag "For Each" activity. Set TypeArgument to Int32. Set Values to SalesArray. This loops through all 50 elements one by one.
  • 4.If Activity inside loop: Inside the For Each body, add an "If" activity with condition: item > maxSales. In the THEN branch, add Assign: maxSales = item. This updates max whenever a larger value is found.
  • 5.Alternative — LINQ: Use a single Assign activity after declaring the array: maxSales = SalesArray.Max(). This uses .NET LINQ to find maximum in one line. Then use Write Line: "Highest Sales: " + maxSales.ToString()
🔁 Workflow Flow
[Assign] SalesArray = {1200, 3400, 2100, 5600, ...} (50 values) [Assign] maxSales = SalesArray(0) [For Each] item In SalesArray └── [If] item > maxSales └── THEN: [Assign] maxSales = item └── ELSE: (do nothing) [Write Line] "Highest Sales Figure: " + maxSales.ToString() OUTPUT: Highest Sales Figure: 5600 ─── Alternative (LINQ, 1 line): ────────────────────────── [Assign] maxSales = SalesArray.Max() [Write Line] "Max: " + maxSales.ToString()
  • 6.Output Panel: The Write Line activity prints to the Output panel in UiPath Studio. The result shows the highest sales figure from all 50 daily values.
  • 7.Index Tracking (bonus): To also find which day had the highest sales, add variable maxIndex (Int32) and currentIndex. Update maxIndex = currentIndex inside the If THEN block. Increment currentIndex each loop iteration using Assign: currentIndex = currentIndex + 1
  • 8.Variables Panel: All variables (SalesArray, maxSales, item) are defined in UiPath Studio's Variables panel located below the Designer panel. The scope should be set to the Sequence level for accessibility throughout the workflow.
✓ STUDIED
9b
Illustrate clipboard management and UI automation in UiPath for an e-commerce order copy-paste workflow, highlighting efficiency and accuracy improvements.
CO2 8 Marks
📦 Scenario: Copy order info from web app → paste into logistics portal for order fulfillment
✍️ Answer
  • 1.Get Text / Copy Activity: Use "Get Text" activity on the web application to extract order information (Order ID, customer name, address, items). Store in variable orderData. Alternatively, use "Copy Selected Text" if the field is selectable.
  • 2.Set to Clipboard Activity: Use "Set To Clipboard" activity with Value = orderData. This places the captured data into the Windows clipboard, ready for pasting.
  • 3.Navigate to Logistics Portal: Use "Open Browser" or "Click" to switch to the logistics portal. Use "Navigate To" for URL-based navigation. The bot switches applications automatically.
  • 4.Type Into / Paste Activity: Use "Type Into" activity on the logistics portal's input field with GetFromClipboard() value, or use keyboard shortcut Ctrl+V via "Send Hotkey" activity (Key=v, Ctrl=checked). This pastes the order data.
  • 5.Field-by-Field Automation: For structured forms, extract individual fields using Get Text for each (Order ID, Address, etc.) and use Type Into for each logistics portal field separately. This ensures accurate field mapping.
  • 6.Efficiency Improvement: The bot completes data transfer in seconds vs. 5-10 minutes manually per order. With UiPath Bot Runner, multiple bots can process parallel orders simultaneously, scaling with order volume.
  • 7.Accuracy Improvement: Eliminates human transcription errors (typos, wrong field, missed items). UiPath uses selector-based targeting — each field is precisely identified by its UI properties, not position, reducing mis-paste errors.
  • 8.Input Methods for Speed: Use "Simulate Type" input method for the logistics portal (works in background, no focus required). Use "SendWindowMessages" for legacy logistics systems. Both are faster and more reliable than Default (hardware driver) method.
📋 Clipboard Automation Flow
[Web App Open] │ ├── Get Text (Order ID) → orderID = "ORD-2024-001" ├── Get Text (Customer) → custName = "John Doe" ├── Get Text (Address) → address = "123 Main St" ├── Get Text (Items) → items = "2x Laptop, 1x Mouse" │ ├── Set To Clipboard → clipboard = orderID + "|" + custName + ... │ [Switch to Logistics Portal] │ ├── Click → Order ID field ├── Type Into → orderID (or Ctrl+V from clipboard) ├── Click → Customer field → Type Into custName ├── Click → Address field → Type Into address ├── Click → Items field → Type Into items ├── Click → Submit Button │ [DONE — Order logged in logistics portal ✓]
— OR —
✓ STUDIED
10a
Design a counter bot: start at 5, increment by 5 each cycle, print value, stop when >50. Compare While vs For Each activity implementation.
CO2 8 Marks
✍️ Answer — Counter Bot with While vs For Each
  • 1.Variable Setup: Create variable counter (Int32) with default value 5. This is the starting value of the sequence.
  • 2.While Activity Implementation: Drag "While" activity. Set Condition: counter <= 50. Inside the body: (a) Write Line: counter.ToString() — prints current value. (b) Assign: counter = counter + 5 — increments by 5. Loop exits when counter exceeds 50.
  • 3.While Output: Prints: 5, 10, 15, 20, 25, 30, 35, 40, 45, 50. When counter becomes 55, condition 55 <= 50 is FALSE — loop stops. Total iterations: 10.
  • 4.For Each Implementation: Create an array variable numArray = {5,10,15,20,25,30,35,40,45,50}. Use "For Each" with TypeArgument Int32. Inside body: Write Line: item.ToString(). This also prints 5 to 50 in steps of 5.
🔄 While vs For Each — Side by Side
══ WHILE ACTIVITY ══════════════════════ ══ FOR EACH ACTIVITY ══════════════════ counter = 5 (initial) numArray = {5,10,15,...,50} While (counter <= 50) For Each item In numArray { { Write Line: counter.ToString() Write Line: item.ToString() counter = counter + 5 } } OUTPUT (both): 5, 10, 15, 20, 25, 30, 35, 40, 45, 50
AspectWhile ActivityFor Each Activity
ControlDynamic — condition checked each iterationFixed — iterates over a predefined collection
Stop conditionDefined in condition (counter <= 50)Stops after last element in array
FlexibilityHigh — can handle unknown iteration countLower — requires pre-built collection
RiskInfinite loop if condition never falseNo risk — bounded by array size
Best forUnknown end condition, dynamic dataKnown collection, processing each item
This problem✅ Better choiceWorks, but less elegant
  • 5.Why While is Better Here: The problem says "stop exactly when value exceeds 50" — this is a condition, not a fixed collection. While directly models this. For Each requires manually creating the array first.
  • 6.Do While Alternative: UiPath doesn't have a Do-While activity natively. To simulate, place the body BEFORE the While condition check, or use a Do While workaround with a Boolean flag.
  • 7.Debugging Tip: Add a breakpoint on the Assign activity during testing to watch counter change in real-time using UiPath's Watch panel.
  • 8.Infinite Loop Prevention: Always ensure the counter is incremented inside the While loop body. Missing the Assign counter = counter + 5 would cause the loop to run forever — a common UiPath beginner mistake.
✓ STUDIED
10b
Build UiPath program: SecureString with default "123456", convert to String, display, prompt user password comparison, max 3 attempts.
CO2 8 Marks
✍️ Answer — SecureString Password Program
  • 1.Variable Setup: Create securePass of type SecureString — default value set by Assign: New System.Net.NetworkCredential("", "123456").SecurePassword. Create attempts (Int32) = 0. Create userInput (String). Create isAuthenticated (Boolean) = False.
  • 2.Convert SecureString to String: Use Assign activity: plainText = New System.Net.NetworkCredential("", securePass).Password. Display using Message Box: "Password (String): " + plainText. This shows "123456" — demonstrating the conversion.
  • 3.While Loop for 3 Attempts: Drag While activity. Condition: attempts < 3 AND NOT isAuthenticated. This ensures maximum 3 tries and exits early if correct password entered.
  • 4.Inside Loop — Input Dialog: Add Input Dialog activity. Title: "Password Check". Label: "Enter Password (Attempt " + (attempts+1).ToString() + " of 3):". Result stored in userInput (String).
  • 5.Password Comparison: Add If activity: Condition: userInput = plainText. THEN: Assign isAuthenticated = True + Message Box "✅ Login Successful!". ELSE: Assign attempts = attempts + 1 + Message Box "❌ Wrong password. " + (3-attempts).ToString() + " attempts left."
  • 6.After Loop — Final Check: After the While, add If: NOT isAuthenticated → Message Box: "🔒 Account locked. Maximum attempts reached. Workflow terminated."
🔐 SecureString Password Workflow
[Assign] securePass = NetworkCredential("","123456").SecurePassword [Assign] plainText = NetworkCredential("", securePass).Password [Message Box] "Password: " + plainText → shows "123456" [While] attempts < 3 AND NOT isAuthenticated │ ├── [Input Dialog] "Enter Password" → userInput │ └── [If] userInput = plainText ├── THEN: isAuthenticated = True │ Message Box "✅ Login Successful!" └── ELSE: attempts = attempts + 1 Message Box "❌ Wrong. " + (3-attempts) + " left." [After While] [If] NOT isAuthenticated └── Message Box "🔒 Account Locked. Max attempts reached."
  • 7.Why SecureString?: SecureString stores passwords encrypted in memory — the string is not stored in plain text, reducing risk of memory-dump attacks. Converting to plain String is only done for comparison; ideally, compare SecureStrings directly using SecureStringHelper.
  • 8.Output Messages: Success path: shows "Login Successful" on correct entry within 3 tries. Failure path: after 3 wrong attempts, shows "Account Locked" and the workflow terminates — simulating a real security lockout mechanism.
🌟 Challenging Question Optional · 5 Marks · Extra Credit
✓ STUDIED
Q11
Design the architectural logic for a Stock Trading Bot (TradeMaster Pro) using State Machine concepts and Event Monitoring. Handles freeze/crash recovery.
CO2 5 Marks ⭐
🤖 Bot monitors TradeMaster Pro (live desktop app). On target price → Buy instantly. Must react in milliseconds. App freezes ~hourly (title changes to "Not Responding"). Recovery: kill process → restart → login → resume monitoring.
✍️ Answer — State Machine Architecture
  • 1.Why State Machine?: State Machines are "suitable for very large projects that use a finite number of states in their execution, triggered by a condition." The bot has well-defined states: Monitoring, Trading, Recovering, Terminated. Transitions are triggered by events (price hit, freeze detected). This architecture ensures clean, predictable behavior.
  • 2.State 1 — MONITORING: The initial state. Bot continuously reads the price display using Get Text (Native method, millisecond polling). Transition trigger: IF price >= targetPrice → transition to TRADING state. Also constantly checks window title — IF title contains "Not Responding" → transition to RECOVERING state.
  • 3.State 2 — TRADING: Entered when target price detected. Actions: (a) Click "Buy" button instantly (using Simulate Click for speed). (b) Type quantity via Type Into (Simulate method). (c) Click "Confirm". On success → transition back to MONITORING. On error → transition to RECOVERING.
  • 4.State 3 — RECOVERING: Triggered when freeze detected (window title = "TradeMaster Pro (Not Responding)"). Actions: (a) Kill process using Kill Process activity. (b) Start Process to relaunch TradeMaster Pro. (c) Wait for app load. (d) Perform login sequence. On success → transition to MONITORING. On repeated failure → TERMINATED state.
  • 5.Event Monitoring: Use "Check App State" or "Element Exists" activity in a loop to monitor the window title. For millisecond price reaction, use "On Element Appear" event trigger — this UiPath event fires the moment a UI element changes, enabling near-instant response without a polling delay loop.
START 👁️ MONITORING Poll price (ms) Watch title 💰 TRADING Click Buy Enter qty + Confirm 🔧 RECOVERING Kill → Restart Login → Resume ❌ TERM- INATED Price hit! Error Recovered! Done Max retries Freeze!
  • 6.Speed Optimization: "Speed is critical. The bot cannot afford to constantly check the price in a slow loop." Use On Element Appear / Find Element with a tight loop and no Delay activities. Use Simulate Click input method — fastest, works in background, no hardware driver wait.
  • 7.Transitions in State Machine: "Transitions contain three sections: Trigger, Condition, and Action." For the freeze detection transition: Trigger = timer/element check, Condition = title contains "Not Responding", Action = move to RECOVERING state and log the event.
  • 8.Global Exception Handler: Add a Global Exception Handler as a safety net for any unexpected crashes. It logs the error, attempts recovery, and if recovery fails multiple times, gracefully moves to the TERMINATED state with an alert notification.