Skip to main content

complex-workflows Scenario 4 — Search → Multi-Tab Detail Extraction → Compile

Written by RTILA X Engineering Team

Intermediate ~6 min
Prerequisites: complex-workflows/1 complex-workflows/2 complex-workflows/3

What You'll Learn

Handle JavaScript dialogs during automation

Real-World Use Case

Dealing with alert() confirmations

LIVE DEMO

Product 1

View Details

Product 2

View Details

Product 3

View Details

Product 4

View Details

Product 5

View Details
Detail for product 1
Detail for product 2
Detail for product 3
Detail for product 4
Detail for product 5
EXPECTED OUTPUT

RTILA X PROJECT JSON

    {
  "name": "Search_Multi_Tab_Extract_Compile",
  "settings": {
    "urls": [
      "https://learn.rtila.com/scenarios/complex-workflows/4"
    ]
  },
  "datasets": {
    "search_results": {
      "item_selector": "css=.cw-search-item",
      "properties": [
        {
          "name": "title",
          "type": "text",
          "selector": "css=.cw-item-title"
        },
        {
          "name": "url",
          "type": "attribute",
          "selector": "css=a.cw-item-link",
          "attribute": "href"
        }
      ]
    },
    "details": {
      "item_selector": "css=.cw-detail",
      "properties": [
        {
          "name": "detail",
          "type": "text",
          "selector": "css=self"
        }
      ]
    }
  },
  "commands": [
    {
      "command": "wait_for_selector",
      "params": {
        "selector": "css=.cw-search-item"
      }
    },
    {
      "command": "extract_data",
      "params": {
        "dataset": "search_results"
      }
    },
    {
      "command": "for_each",
      "params": {
        "source_type": "dataset",
        "dataset": "search_results",
        "as": "result",
        "do": [
          {
            "command": "click",
            "params": {
              "selector": "css=a.cw-item-link"
            }
          },
          {
            "command": "wait_for_selector",
            "params": {
              "selector": "css=.cw-detail"
            }
          },
          {
            "command": "extract_data",
            "params": {
              "dataset": "details"
            }
          }
        ]
      }
    }
  ]
}
  

Search results are extracted first, then each item is opened to gather additional detail data. The dataset loop compiles all results into one collection.

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 1 RTILA X command and is referenced in 1 learning article.

Continue Learning

Was this helpful?