> 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/when-the-test-doesnt-work/recording-issues/recording-tooltip-assertion.md). Agents can also search and read this documentation through its [MCP server](https://help.autify.com/~gitbook/mcp).

# ツールチップに対するアサーションをレコーディングする

## ツールチップに対するアサーション

ツールチップはマウスオーバーを外すと消えてしまうため、レコーディングでツールチップにアサーションを追加する場合は、次に紹介するいずれかの方法でアサーションを追加してください。

{% hint style="info" %}
**ホバーステップ**

ツールチップに対するアサーションステップの前には、ツールチップを表示させるための[ホバーステップ](https://help.autify.com/nocode-web/autify-university/foundation/creating-a-scenario/hover-step.md)が必要です。
{% endhint %}

## アサーションの追加方法

ツールチップの実装は、主に「HTMLとCSSだけで実装する」方法と「JSで実装する方法」の2パターンあり、それぞれでアサーションの追加方法が異なります。

## HTMLとCSSで実装したツールチップにアサーションを追加する方法

ツールチップをCSSで非表示にしておき、親要素がホバーされたときにツールチップの非表示を解除する実装をHTMLとCSSでしている場合は、ChromeのデベロッパーツールのForce stateで、対象要素に対して`:hover`を設定しhover状態にすることで、ツールチップが表示されたままの状態になるため、アサーションを追加することが可能です。

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

## JSで実装したツールチップにアサーションを追加する方法

JSでツールチップを実装している場合は、以下いずれかの方法でアサーションを追加できる可能性があります。

### マウスオーバーを行うスニペットでツールチップを表示する

デベロッパーツールのコンソールから[マウスオーバーを行うスニペット](https://javascript-snippets.autify.com/ja/snippets/mouse/mouseover/)を対象要素に対して実行し、ツールチップを表示させてから、アサーションを追加してください。

### マウスオーバーを行うスニペットでもアサーションを追加できない場合

[マウスオーバーを行うスニペット](https://javascript-snippets.autify.com/ja/snippets/mouse/mouseover/)でツールチップを表示しても、アサーション追加時に要素が消えてしまう場合は、以下の方法でアサーションを追加できる可能性があります。

1. ツールチップの[CSSセレクターやXPathを取得](https://help.autify.com/nocode-web/autify-university/advanced/locator-feature/how-to-get-css-selectors.md)する。
2. 適当な要素に対して希望のアサーションを追加し保存する。
3. ツールチップのCSSセレクター/XPathをアサーションステップの[ロケータ](https://help.autify.com/nocode-web/autify-university/advanced/locator-feature/add-a-locator.md)に設定する。
4. アサーションステップの期待値をツールチップの文言などに修正する。

## それでも問題が解決しない場合...

いつでもカスタマーサポートチームにご連絡ください。問題を解決するお手伝いをいたします。


---

# 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/when-the-test-doesnt-work/recording-issues/recording-tooltip-assertion.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.
