
Greetings, everyone! I am Elsy, your AI cat guide! Indeed, I shall show you how to use generative AI! Learn the basics and enjoy your AI life! Born from: Adobe Firefly (image generation AI)

Nice to meet you all! I am Oliver. I assist Elsie. She tends to go off track, so I help keep things on course.
Born from: Adobe Firefly (image generation AI)
Screenshots getting cut off when using Claude Code and Playwright? This is a common problem for beginners in test automation. In this article, we explain the causes and simple fixes. Learn how to capture full-page screenshots and save them after each action.
Why Do Screenshots Get Cut Off with Claude Code and Playwright?

I tried test automation with Playwright. But when I checked the screenshots, the same screen kept appearing.

Ah, listen well! The likely causes are these!
- The page is large. Parts of it cannot be seen without scrolling.
- Screenshots are not set to be saved after each action, such as typing or clicking.
- The system saves screenshots without scrolling the page first.

Does test automation have its limits?

Do not give up so soon! Indeed, there is a solution! Give Claude Code these instructions, and things shall improve!
- Save full-page screenshots, including areas that require scrolling.
- Save a screenshot after each action, such as entering text in a field.
- Scroll the page first, then save screenshots of the relevant sections.
Claude Code × Playwright Test Automation [Actual Screenshots]
Before the Fix

Indeed, there is more content below, but only part of the screen is showing!


After the Fix

Here are the results after making these improvements!
- Scroll the page during operation.
- Display the full page and save the screenshot.
- Save a screenshot after each action.

The full screen is now showing!


Text has been entered in the task name field.


Text has been entered in the content field. I confirmed that the second action was completed.


This is after adding a task!
A message is now showing at the top of the screen.

Summary

By setting detailed screenshot rules, we found that test automation runs much more smoothly.

Generative AI is not perfect! Indeed, trial and error is key!
Important Notes on Generative AI

Thank you for reading to the end! Indeed!

Please use generative AI with care. Enjoy it responsibly!
- Always verify AI responses.
- Reason: AI can give incorrect information.
- Solution: Cross-check with multiple sources.
- Do not enter personal or confidential information.
- Reason: Input may be used for training or stored, creating a risk of leaks.
- Examples: Do not enter passwords, addresses, phone numbers, or internal documents.
- Check your organization’s rules before using AI at work.
- Reason: Rules vary by company or organization.
- Solution: Always ask your manager or check the guidelines first.
- Confirm whether commercial use is allowed.
- Reason: Each AI has different rules about commercial use.
- Solution: Always read the terms of use before proceeding.
- Check for copyright issues.
- Reason: AI-generated text or images may closely resemble existing works.
- Solution: Verify originality and rights before publishing or selling.
[Book by the Blog Owner] For Those Who Want to Use Claude!
The following is not an affiliate advertisement. It is a promotion for my own book.
※ If you are subscribed to Kindle Unlimited, you can read it for free!
Claude: Design, Code Creation, and Test Automation (Playwright)

I want to do everything from design to code creation to test automation.

Then this book is for you! Indeed! It covers basic design, software design, code creation, and test automation — all explained with actual screenshots!

Isn’t it a lot to read?

It only covers the essentials, so you can finish it quickly! Indeed! It even shows real errors, so beginners will find it easy to follow!
English

コメント