メインコンテンツへスキップ

概要

各ステップには type フィールドを持つ action オブジェクトがあります。使用可能なフィールドはアクション型によって異なります。

共通アクションフィールド

フィールド必須説明
typeActionTypeYes以下の12種類のアクション型
selectorSelector型による対象要素(click, input, select, hover で必須)
valuestring型によるテキスト値 — {{variable}} テンプレート構文対応

アクション型

click

DOM 要素をクリックします。
action:
  type: click
  selector:
    tagName: button
    innerText: "Submit"
フィールド必須説明
selectorYesクリックする要素

input

フォームフィールドにテキストを入力します。入力前にフィールドはクリアされます。
action:
  type: input
  value: "{{email}}"
  selector:
    tagName: input
    inputType: email
フィールド必須説明
selectorYes入力要素
valueYes入力テキスト({{variable}} テンプレート対応)

select

<select> ドロップダウンからオプションを選択します。
action:
  type: select
  value: "us-west-2"
  optionText: "US West (Oregon)"
  selector:
    tagName: select
    name: "region"
フィールド必須説明
selectorYesselect 要素
valueNoオプションの value 属性
optionTextNo表示テキスト(value 未設定時に使用)
ブラウザを URL に遷移させます。
action:
  type: navigate
  url: "https://app.example.com/dashboard"
フィールド必須説明
urlYes遷移先 URL

scroll

ページをスクロールします。追加フィールドは不要です。
action:
  type: scroll

wait

指定の条件または一定時間待機します。非同期ロードのページで有用です。
action:
  type: wait

hover

要素にホバーしてメニューやツールチップを表示します。
action:
  type: hover
  selector:
    tagName: div
    ariaLabel: "User menu"
フィールド必須説明
selectorYesホバーする要素

extract

ページコンテキストで JavaScript を実行し、結果をキャプチャします。
action:
  type: extract
  script: "document.querySelector('.total').textContent"
captures:
  - name: totalAmount
    strategy: expression
    expression: "{{__extracted}}"
フィールド必須説明
scriptYesページで評価する JavaScript
抽出された値は {{__extracted}} としてキャプチャで使用できます。

download

クリックやナビゲーションでトリガーされるファイルをダウンロードします。
action:
  type: download
  downloadPath: "./downloads/report.csv"
  selector:
    tagName: a
    innerText: "Download CSV"
フィールド必須説明
selectorNoダウンロードをトリガーする要素
downloadPathNoファイルの保存先パス

export

メモリコレクションを CSV または JSON ファイルにエクスポートします。
action:
  type: export
  exportCollection: "products"
  exportFormat: csv
  exportPath: "./output/products.csv"
フィールド必須説明
exportCollectionYesメモリコレクション名
exportFormatYescsv または json
exportPathYes出力ファイルパス

memory

メモリ操作(append または aggregate)を実行します。このアクション型はショートハンドです。任意のステップで memoryOperations を使用することもできます。
action:
  type: memory
詳細はメモリ操作を参照してください。

key

キーボードキーまたはキーの組み合わせを押します。
action:
  type: key
  keys: "Enter"
フィールド必須説明
keysYesPlaywright 形式のキー名(例: Enter, Tab, ArrowDown, Control+a

サマリーテーブル

アクションセレクタその他のフィールド
click必須
input必須必須
select必須任意optionText
navigateurl
scroll
wait
hover必須
extractscript
download任意downloadPath
exportexportCollection, exportFormat, exportPath
memory
keykeys