--- title: "Verifying clipboard content" slug: "verifying-clipboard-content" updated: 2025-05-30T03:43:56Z published: 2025-05-30T03:43:56Z 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. # Verifying clipboard content Some websites allow users to copy a value, like a URL or some text, to the clipboard by clicking a button (e.g., “Copy to clipboard” in the screenshot below). The following snippet allows you to check that the correct value was actually copied. ![](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-10-27T20%3A41%3A59Z&se=2026-10-27T21%3A41%3A59Z&sr=c&sp=r&sig=YEuDXNe%2F4xe%2B7dBWw8jCaiMpUgoM6X45pMoTRcuAp3Y%3D) ## How to set it up 1. Add a Playwright code step after the step that clicks the “Copy” button. 2. Paste the following code into the Playwright step: ```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. Replace `expected_copied_text_value` with the expected value you want to assert against. > [!WARNING] > The code in this step may capture other content if you copy/paste something else on your computer when it’s being executed