For a screenshot taken during a Rails system test, use Rails’ take_screenshot helper. For a guaranteed full-scroll capture, use a browser automation API that explicitly supports full-page screenshots: Playwright provides that option, but its documented examples are JavaScript and Python, not Ruby. Rails 8.0.4’s screenshot helper captures the current browser page; its API does not document a full-page option, so do not assume it captures content below the viewport.
Choose the method that matches the screenshot you need
| Approach | Best fit | Full-page behavior | Useful output options |
|---|---|---|---|
| Rails system-test screenshot helper | Capturing the state reached by a Rails system test, especially while debugging a failure | The Rails 8.0.4 reference says it captures the current page; it does not document an explicit full-page setting | Configurable save directory and optional HTML artifact |
| Playwright screenshot API | Capturing the full scrollable page through browser automation | Explicitly supported with fullPage: true in JavaScript or full_page=True in Python |
Path, image type, quality, clip, scale, masking and animation handling |
These are complementary options, not interchangeable Rails methods. Use Rails’ helper when test integration and failure artifacts matter. Choose a browser API with a documented full-scroll option when the screenshot must include content below the viewport. Playwright’s documentation does not establish a particular Rails integration; confirm the API and setup for any Ruby integration before adapting the examples.
Capture a screenshot in a Rails system test
Rails documents take_screenshot in its Rails 8.0.4 ScreenshotHelper API. Call it after navigating to the page and putting the browser into the state you want to inspect. The helper captures the current browser page, and its documented default output directory is tmp/screenshots.
Minimal system-test example
In a system test that already uses Rails’ system-testing setup, the call is:
#1 Best Overall
- Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
- Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
- Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
- Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
- 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
take_screenshot
For example, place it after the interaction you want to examine:
class CheckoutTest < ApplicationSystemTestCase
test "shows the order confirmation" do
visit checkout_path
# Complete the steps needed to reach the state under test.
take_screenshot
end
end
This is a Rails helper call, not a standalone screenshot command. It depends on the system-test browser session being available. You can call it more than once in a test; Rails documents sequential filenames for those captures.
Change the output directory
Set Capybara.save_path to choose a different location for screenshot artifacts. Configure it as part of your test setup, before calling the helper:
Capybara.save_path = Rails.root.join("tmp", "system-test-shots").to_s
Create or verify the destination as appropriate for your test environment, then inspect that directory after the test. If you use a relative path or a path that differs between local and CI runs, make sure the test process can write there and that your CI job preserves the artifact directory.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Rank #2
- 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
- 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
- Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
- 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
- What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
Save the page HTML for debugging
When a picture alone does not explain the browser state, Rails’ helper can also save the current page’s HTML. The API documents an html option and an environment-variable route for requesting HTML. Consult the Rails 8.0.4 API reference for the exact option details for your installed version. HTML can help determine whether expected elements were present even if they were outside the visible area; it is not a substitute for a full-page image.
Capture automatically after a test failure
Rails documents take_failed_screenshot as a teardown helper. It checks that the test failed, screenshot support is available, and a Capybara session exists before taking the screenshot. Use it when you want failure artifacts rather than adding a manual capture to every test. This behavior is documented for Rails 8.0.4; check the API documentation for your own Rails version before relying on the same method or configuration.
Take a full-scroll screenshot with Playwright
Playwright’s page screenshot API explicitly supports capturing the full scrollable page. The official Playwright screenshot guide documents the JavaScript form. The API reference also defines the available screenshot controls; see Page.screenshot.
JavaScript: full-page PNG
In a Playwright script with a page already open, use:
Rank #3
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
await page.screenshot({ path: 'screenshot.png', fullPage: true });
The fullPage setting defaults to false. Setting it to true requests the full scrollable page rather than only the viewport. The example assumes the page and browser have already been created and navigated to the target route.
Python equivalent
Playwright documents the corresponding Python spelling as:
page.screenshot(path="screenshot.png", full_page=True)
Python uses the underscore-form keyword full_page; do not copy the JavaScript camel-case option into this call.
Other screenshot controls
The screenshot API includes options that affect the artifact. Pick them based on the task rather than adding options blindly:
Free tools Windows power users keep installed
One-click scans. No signup required.
Rank #4
- Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
- Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
- Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
- Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
- Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
- Path and type:
pathchooses where the image is saved. The API supports a screenshot type such as PNG or JPEG; check the API reference for the supported type and output behavior in your installed Playwright version. - Quality:
qualitycontrols lossy image quality where applicable. It is relevant when choosing a compact lossy image format, not a reason to expect a smaller lossless PNG. - Clip:
clipcaptures a selected rectangle rather than serving as a replacement for full-page capture. Use it when a specific region is the target. - Scale: CSS scale produces one image pixel per CSS pixel and can keep high-DPI output smaller. Device scale records device pixels and can result in images two times larger or more. Choose CSS scale for a compact artifact or device scale when device-pixel fidelity matters.
- Masking and animation handling: the API documents masking and animation-related controls for stabilizing or obscuring elements in a capture. Check the reference for exact option syntax and behavior before adding them.
Full-page images can be much taller than viewport captures. Consider the intended use: a review artifact may benefit from readable detail, while a stored or transmitted image may need a smaller scale or a different format. No one format or scale is correct for every page.
Use the Playwright CLI for a one-off capture
If the page is already accessible to the Playwright command-line tool, its screenshot command supports a full-page flag, a custom filename, image type, and --hires. The official Playwright CLI documentation describes those options. Use the installed CLI’s help output to confirm the exact invocation and flags for your version rather than assuming commands from another release.
The CLI documentation distinguishes visual screenshots from accessibility snapshots: use a screenshot for visual checks, and an accessibility snapshot when you need to understand page structure or read text. A tall image is not a reliable substitute for structured page information.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Make the capture useful in a Rails workflow
Capture the state you intend to inspect
A screenshot only records the browser state at the moment the capture runs. In a system test, navigate and perform the relevant actions first. With a browser automation API, make sure the page is at the target URL and that the needed content has appeared before taking the image. If the capture happens too early, a screenshot may show a loading state rather than the finished page.
Best Value
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
Choose an artifact location your team can retrieve
For Rails helper captures, the default is tmp/screenshots; change it with Capybara.save_path when another directory better suits your workflow. For Playwright, set path to the artifact location required by your script or CI job. In continuous integration, confirm both that the process can write to the directory and that the job uploads or retains the result.
Decide whether you need pixels, markup, or both
Use an image when visual appearance, layout, or a rendering regression is the question. Rails’ optional HTML artifact can help diagnose what markup was present at capture time. For understanding page structure or reading text, Playwright’s CLI documentation points to accessibility snapshots rather than screenshots. These artifacts answer different questions; collecting more than one can make a test failure easier to diagnose.
Troubleshoot common screenshot problems
- The screenshot shows only the visible browser area. Rails’ cited helper documentation describes a current-page screenshot and does not document a full-page option. For an explicitly full-scroll image, use an API that documents that behavior, such as Playwright with
fullPage: trueorfull_page=True. - No Rails screenshot appears. Confirm the test is running as a system test with an active Capybara session, then check
tmp/screenshotsor the configuredCapybara.save_path. Also check that the test process can write to the destination. - A failure screenshot is missing.
take_failed_screenshotis conditional: Rails documents checks for a failed test, available screenshot support, and an existing Capybara session. Confirm those conditions and verify the API against your Rails version. - The screenshot captures a loading or incomplete page. Move the capture after the relevant navigation and interactions have completed. For automated browser captures, ensure the page state you need is ready before calling the screenshot API.
- The image is unexpectedly large. A tall full-page capture contains more pixels than a viewport screenshot. Consider CSS scale, which records one pixel per CSS pixel, instead of device scale when compact output is more important than device-pixel detail.
- A JavaScript option is rejected in Python. Use Playwright’s Python keyword spelling
full_page=True, not JavaScript’sfullPage: true. - You are using a Ruby Playwright integration. The cited Playwright examples establish JavaScript and Python syntax, not a particular Rails or Ruby integration. Check the API and version of the Ruby integration you installed; do not assume its method names or options match either example exactly.
Or skip the browser setup
If you need a screenshot from a URL without wiring browser automation into a Rails workflow, ScreenshotNeo provides a website screenshot API. Its documented endpoint accepts a URL and returns an image or PDF. See the ScreenshotNeo website and API documentation for request parameters and response details.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
Replace YOUR_API_KEY and the target URL with your values. The request saves the response as shot.webp. For an API-based capture, ScreenshotNeo’s distinguishing points are concrete: it accepts cookie/consent banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets before the shot; bot checks/CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed; and an MCP server lets AI agents use take_screenshot, get_page_info, and capture_pdf. The free plan includes 1,000 shots per month with no card, and paid plans start at $5 for 3,000 shots.
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchSign up for ScreenshotNeo’s free plan to try 1,000 screenshots a month with no card.
Version and integration checks
The Rails helper behavior described here is pinned to the Rails 8.0.4 API reference. The Playwright material comes from its current documentation branch and CLI documentation; those pages do not establish one specific Rails integration. Since browser automation integrations and framework APIs can change, check the documentation for the versions actually installed in your project before adopting version-sensitive syntax.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

