> For the complete documentation index, see [llms.txt](https://help.autify.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.autify.com/nocode-web/autify-university/foundation/creating-a-scenario/open-switch-window-step.md). Agents can also search and read this documentation through its [MCP server](https://help.autify.com/~gitbook/mcp).

# ウィンドウを開く・切り替えるステップ

## 新規ウィンドウを開く

今いるウィンドウとは別に、新規でウィンドウを立ち上げてURL遷移するには、「ウィンドウを開く」ステップが必要です。

![](https://50135409-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fof7cb8AGXhWvWThq3R0w%2Fuploads%2Fgit-blob-618ce583b8d17d17254ec4d69f16251b219489cb%2Fja-window-open.png?alt=media)

### ステップの作成

ウィンドウを開くステップを追加する方法は以下の2つです。

* レコーディング中にAutifyレコーダーから[ページ遷移を追加](https://help.autify.com/nocode-web/autify-university/foundation/creating-a-scenario/go-to-url-button.md)する(Open in new windowにチェックを入れる)。
* シナリオ編集画面の「ステップを挿入」から **ウィンドウを開くステップ** を選択する。

### 元のウィンドウに戻る

新しく開いたウィンドウで一通りレコーディングをし、元いたウィンドウに戻るには、実際に元いたウィンドウに戻る操作をし、そのウィンドウで何かしらの操作をすると、「[最初のウィンドウに切り替える](#switch-to-initial-window)」もしくは「[ステップ Nのウィンドウに切り替える](#switch-to-step-n-s-window)」というステップが追加されます。

![](https://50135409-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fof7cb8AGXhWvWThq3R0w%2Fuploads%2Fgit-blob-d54c1103281b217561995d681427236dbc2d05d9%2Fja-switch-to-initial-window.png?alt=media)

## 同一ウィンドウ内でタブを切り替える

同一ウィンドウ内でタブを開いたり、タブを切り替えたりしたい場合は、「ウィンドウに切り替える」ステップが必要です。

### ステップの作成

「ウィンドウに切り替える」ステップは、シナリオ編集画面からは追加することができないため、必ずレコーディングで作成する必要があります。レコーディング中に新規タブを開くトリガーとなる要素をクリックしたり、タブを切り替える操作を実際にすることで、自動的にステップが追加されます。

タブを切り替えるステップには以下があります。

#### 新しいウィンドウに切り替える

リンクやボタンのクリックで、新しいタブが開いた時に作成されます。

![](https://50135409-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fof7cb8AGXhWvWThq3R0w%2Fuploads%2Fgit-blob-952f08c450f5804cbf1a7f7ba59150d1feae6e30%2Fja-switch-to-new-window.png?alt=media)

#### 最初のウィンドウに切り替える <a href="#switch-to-initial-window" id="switch-to-initial-window"></a>

現在いるタブから、ステップ1で開いたタブに切り替えた際に作成されます。 現在いるウィンドウからステップ1で開いたウィンドウに切り替えた際もこのステップが作成されます。

![](https://50135409-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fof7cb8AGXhWvWThq3R0w%2Fuploads%2Fgit-blob-3bd2fc180e2126a0c0996823d869bf35a07aa8c4%2Fja-switch-to-initial-window-step.png?alt=media)

#### ステップNのウィンドウに切り替える <a href="#switch-to-step-n-s-window" id="switch-to-step-n-s-window"></a>

現在いるタブから、ステップN(1以外)で開いたタブに切り替えた際に作成されます。 現在いるウィンドウから、ステップN(1以外)で開いたウィンドウに切り替えた際もこのステップが作成されます。

![](https://50135409-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fof7cb8AGXhWvWThq3R0w%2Fuploads%2Fgit-blob-64edb5e370522c637fc1f866e915b5bd99e9b31c%2Fja-switch-to-ns-window.png?alt=media)

このステップには「次のステップで開かれたウインドウに切り替える」という項目があり、任意のステップで開いたウィンドウに切り替えることができます。

![](https://50135409-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fof7cb8AGXhWvWThq3R0w%2Fuploads%2Fgit-blob-7ce694f45ef3ba4c3660b8e072d4a6ab1ebc6ba5%2Fja-target-window.png?alt=media)

## ウィンドウ・タブを閉じる

レコーディング中にウィンドウやタブを実際に閉じることで、「ウィンドウを閉じる」ステップが自動で追加されます。ウィンドウを閉じた後に移動したウィンドウ・タブによって、「最初のウィンドウに切り替える」もしくは「ステップNのウィンドウに切り替える」ステップも自動で追加されます。

![](https://50135409-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fof7cb8AGXhWvWThq3R0w%2Fuploads%2Fgit-blob-86892a5278e26332ba4d7b443d2bb565a8e79871%2Fja-close-window.png?alt=media)

「ウィンドウを閉じる」ステップは、シナリオ編集画面からは追加することができないため、必ずレコーディングで作成する必要があります。

## 留意点 <a href="#notes" id="notes"></a>

* ウィンドウ・タブを切り替える時は、「ウィンドウに切り替える」ステップがないと、正常にウィンドウ・タブを切り替えることができず、テストやローカルリプレイが失敗します。
* 「ウィンドウに切り替える」ステップを誤って消してしまった場合は、任意のステップで、任意の操作で作成した「ウィンドウに切り替える」ステップを、誤って消してしまったステップの代わりに使用することが可能です。
* Apple/iOSの制約により、iOS実機環境では新規「ウィンドウを開く」操作、「新しいウィンドウに切り替える」操作および「ステップNのウィンドウに切り替える」操作をサポートしていません。さらに、JSステップによるクリックで新しいウィンドウを開くことができません。
  * しかし、iOS実機環境であっても、Webアプリケーションがクリック操作によって新しいウィンドウを直接開くことができる仕組みの場合、iOS実機環境でも実行できる可能性があります。クリック操作によって新しいウィンドウを直接開くことができるケースかどうかはお客様にてご確認いただく、もしくはテスト実行結果URLと手動操作許可があれば弊社側で調査可能ですのでご連絡ください。
* ページ内のボタンをクリックすることでタブを閉じることができる場合、ボタンをクリックすると「クリック」ステップと「ウィンドウを閉じる」ステップが追加されることがあります。「クリック」ステップでタブを閉じれるため、「ウィンドウを閉じる」ステップは不要になります。不要な「ウィンドウを閉じる」ステップがある状態で、ChromeやEdgeでテストを実行すると内部エラーが発生する可能性があります。この問題は、不要な 「ウィンドウを閉じる"」ステップを削除することで解決できます。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.autify.com/nocode-web/autify-university/foundation/creating-a-scenario/open-switch-window-step.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
