--- title: "クリップボードの内容を検証する" slug: "verifying-clipboard-content" updated: 2025-06-12T11:53:52Z published: 2025-06-12T11:53:52Z canonical: "helpcenter.autify.com/verifying-clipboard-content" --- > ## Documentation Index > Fetch the complete documentation index at: https://helpcenter.autify.com/llms.txt > Use this file to discover all available pages before exploring further. # クリップボードの内容を検証する *※ このトピックの一部は機械翻訳で処理されています。* 一部のWebサイトでは、ユーザーがボタン(例:「クリップボードにコピー」)をクリックすることで、URLやテキストなどの値をクリップボードにコピーできるようになっています。 以下のスニペットを使用すると、**正しい値が実際にコピーされたかどうか**を確認できます。 ![](https://cdn.document360.io/c040854c-2c75-49d0-98e1-43f462e8657e/Images/Documentation/Screenshot 2025-05-26 at 17.13.03.png?sv=2026-02-06&spr=https&st=2026-11-29T20%3A55%3A13Z&se=2026-11-29T21%3A55%3A13Z&sr=b&sp=r&sig=n5GAwPQV%2B9Mcas07%2F3fWu6On8eW5jUW0KL29hGL1C4w%3D) ## 設定方法 1. 「コピー」ボタンをクリックするステップの**直後に**、Playwrightコードステップを追加します。 2. Playwrightコードステップ内に、以下のコードをペーストします。 ```typescript // Grant clipboard permissions for reading and writing context.grantPermissions([  'clipboard-write',  'clipboard-read', ]); // Read the clipboard content const result = await page.evaluate(async () => {  return await navigator.clipboard.readText(); }); // Verify that the clipboard contains the expected text expect(result).toContain('expected_copied_text_value'); // Optional: Log the clipboard value to the browser console await page.evaluate(r => console.log(r), result); ``` 1. `expected_copied_text_value` の部分は、検証したい**期待値**に置き換えてください。 > [!WARNING] > このステップが実行されている間にPC上で他のコピー/ペースト操作を行った場合、その内容が読み取られてしまう可能性があります。