> 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/test-results/when-a-step-fails.md). Agents can also search and read this documentation through its [MCP server](https://help.autify.com/~gitbook/mcp).

# ステップが失敗した場合の対応

テスト結果の確認では、成功したテストの例をご紹介しました。では、テストが失敗すると、どうなるでしょうか？

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

成功したテストと違う部分がいくつかありますね。画面上部には「失敗」というステータスが表示されています。その下のエラーメッセージは、問題点を特定するためのヒントとなります。この例では、JavaScriptを実行するステップ6でエラーが発生したようです。「Purposely breaking test to show a fail」というJavaScriptエラーが表示されています。

ステップ6に移動して詳しく見てみましょう。

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

画面上部を見ると、問題の原因はJavaScriptであり、サイト自体には問題がないことが分かります。このテストが失敗するよう、意図的にエラーを挿入しておいたのです。

ここで、初めてテストを作成する場合に知っておきたいポイントが1つあります。レコーディングしたシナリオをそのまま実行しても、必ず成功するとは限らないということです。特に、JavaScriptを使用した場合はエラーが発生する可能性があります。エラーが発生する原因はたくさんありますが、テスト実行ができるようにするには、編集が必要になるケースもあるということを押さえておきましょう。


---

# 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/test-results/when-a-step-fails.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.
