Skip to main content

complex-workflows Scenario 9 — Categorize Products by Stock Status

Written by RTILA X Engineering Team

Advanced ~10 min
Prerequisites: complex-workflows/4 complex-workflows/5 complex-workflows/6

What You'll Learn

Handle complex error recovery across workflows

Real-World Use Case

Ensuring no data is lost when a step fails

LIVE DEMO

Wireless Mouse

In Stock $24.99

USB-C Hub

In Stock $39.99

Mechanical Keyboard

In Stock $89.99

4K Monitor

Out of Stock $329.99

Webcam

In Stock $59.99

Laptop Stand

In Stock $45.99

USB-C Adapter

In Stock $19.99

HDMI Cable

Out of Stock $12.99

Keyboard Cover

Out of Stock $9.99

Bluetooth Speaker

Out of Stock $149.99
EXPECTED OUTPUT

RTILA X PROJECT JSON

    {
  "name": "Categorize_Products_By_Stock",
  "settings": {
    "urls": [
      "https://learn.rtila.com/scenarios/complex-workflows/9"
    ],
    "headless": false,
    "navigation_timeout": 30000,
    "max_concurrent_workers": 1,
    "humanoidEnabled": true,
    "humanoidSensitivity": "medium"
  },
  "datasets": {
    "products": {
      "item_selector": "css=.cw-product",
      "properties": [
        {
          "name": "name",
          "type": "text",
          "selector": "css=.cw-product-name"
        },
        {
          "name": "in_stock",
          "type": "attribute",
          "selector": "css=.cw-stock-status",
          "attribute": "data-in-stock"
        },
        {
          "name": "price",
          "type": "text",
          "selector": "css=.cw-product-price"
        }
      ]
    }
  },
  "commands": [
    {
      "command": "goto",
      "params": {
        "url": "https://learn.rtila.com/scenarios/complex-workflows/9"
      }
    },
    {
      "command": "wait_for_selector",
      "params": {
        "selector": "css=.cw-product"
      }
    },
    {
      "command": "extract_data",
      "params": {
        "dataset": "products"
      }
    },
    {
      "command": "comment",
      "params": {
        "text": "Trigger chain can split results by in_stock attribute"
      }
    }
  ]
}
  

The stock status is captured from a data attribute. A trigger chain can separate the rows into two categories for reporting or export.

Did you complete this scenario?

Ready to run this automation?

Copy the project JSON above, open RTILA X, create a new project, and paste it.

This scenario covers 2 RTILA X commands and is referenced in 2 learning articles.

Continue Learning

Was this helpful?