Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

You can visit a CodePen page with Cypress, but automating the app inside its embedded preview is not a reliable current approach: Cypress does not normally support communication with cross-origin embedded iframes. For dependable behavior tests, run the app at a local or deployed URL you control. If you only need to verify where a link points, assert its href without following it.

Why the CodePen preview is difficult to test

A CodePen page can contain an app inside an iframe whose origin differs from the page around it. Cypress documents that it cannot normally automate or communicate with a cross-origin embedded iframe. Its cy.origin() command does not change that: it supports commands after top-level navigation to another origin, not commands inside a cross-origin frame embedded in the current page. See the Cypress Cross Origin Testing guide.

The older Cypress recipe for testing CodePen is explicitly marked obsolete. In a December 5, 2017 article, Cypress said CodePen had added CAPTCHA to prevent scrapers and third-party tools and warned that the approach shown no longer worked: Testing apps hosted on Codepen.io. Do not rely on that article’s iframe-query code as a current recipe.

Choose the test that matches your goal

Approach Best for Limitation
Test the app at a URL you control Checking app behavior and interactions You need to run or deploy the app at that URL.
Assert an external link’s href Confirming a destination without opening a third-party site Does not test behavior on the destination site.
Use cy.origin() Continuing a test after top-level navigation to another origin Does not provide access to an embedded cross-origin iframe.
Investigate CodePen Debug Mode Potentially testing a Pen through a different route CodePen’s available source is a 2019 post; check current availability and account terms before relying on it.

Test app behavior at an origin you control

For an app you own, run it locally or deploy it to a controlled test URL, then point Cypress at that app rather than trying to drive the CodePen preview. This keeps the test focused on your app and its behavior. Cypress recommends favoring destinations under your control when a test must navigate between origins; see its cross-origin testing guidance.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • 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.

The exact server command depends on how your app is built, so start the app using its normal development or test workflow and visit the resulting URL in the Cypress test. No particular CodePen export workflow is assumed here.

Verify a link without navigating to its destination

If the requirement is that a CodePen page or your app links to the right place, keep Cypress on the page you control and assert the expected URL. Cypress recommends this over navigating into a site the test author does not control; it also describes cy.request() as an option when you need to inspect response content.

Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 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.
cy.visit('http://localhost:8080')
cy.get('a')
  .should('have.attr', 'href', 'https://example.com')

Replace the sample page, destination, and broad a selector with the actual values and a selector that identifies the link under test. This verifies the link attribute; it does not test the destination app’s internal behavior.

Use cy.origin() only for top-level cross-origin navigation

When a test clicks through to a second origin and continues interacting with that destination as the top-level page, put the destination’s Cypress commands inside cy.origin(). The origin must match the destination, including scheme, hostname, and port where applicable. Cypress documents the command and its args option in the cy.origin() API.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • 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.
cy.visit('https://your-controlled-app.example')
cy.get('a').click()

cy.origin('https://second-origin.example', () => {
  cy.get('h1').should('be.visible')
})

This is a top-level navigation example, not a way to reach into the CodePen preview iframe. Under current documented defaults, Cypress v14 stopped injecting document.domain by default; follow the current cross-origin guide if your test depends on that behavior.

When iframe access can work

Cypress can query an iframe when it is same-origin with the test page: the frame’s document can be wrapped and queried using normal Cypress commands, as described in the Cypress FAQ. That exception does not make a cross-origin CodePen preview supported. If you control the app and its hosting, prefer serving it at the same origin as the test page or testing it separately at its own controlled URL.

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • 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

chromeWebSecurity: false is not a general fix. Cypress describes it as a constrained workaround with browser-support limitations; consult the cross-origin guide before considering it.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Check CodePen Debug Mode cautiously

CodePen’s July 17, 2019 post, Test Pens with Cypress, describes Debug Mode with CodePen Pro as an easier route around the preview iframe issue. That is a historical suggestion, not confirmation of current plan inclusion or availability. Check CodePen’s current documentation and your account access before building a test workflow around it.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 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.

Troubleshoot common failures

  • Cypress reports a cross-origin iframe limitation: The app is inside an embedded frame from another origin. Test the app at a controlled URL, or test a same-origin frame if you control its hosting; cy.origin() will not reach into the embedded frame.
  • The old CodePen example now fails or encounters a CAPTCHA: Cypress’s 2017 post says the method became obsolete after CodePen added CAPTCHA protections. Do not treat its iframe code as a current supported recipe; move the behavior test to a controlled app URL.
  • Commands after clicking a link fail on a second origin: If the click performs top-level navigation and the test must continue there, wrap the destination commands in cy.origin() and use the exact destination origin.
  • A link test unexpectedly opens an external site: If the requirement is only to check the destination, assert the href instead of clicking the link.
  • Debug Mode does not appear in the account or behave as expected: The cited CodePen guidance dates to 2019. Verify current feature availability and plan terms with CodePen rather than assuming the old post describes today’s offering.

Or skip the browser setup

If the job is to capture a screenshot rather than test interactive behavior, ScreenshotNeo can return an image with one GET request. It accepts cookie or consent banners like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; those steps can be turned off. Bot checks, blank pages, failed loads, timeouts, and cache hits are not billed, and responses identify the page verdict and billing status in headers. Its MCP server provides screenshot and PDF tools for AI agents.

Example cURL request (replace https://stripe.com with the page to capture):

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

See the ScreenshotNeo API documentation for request options. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000. Sign up for free.

Frequently Asked Questions

Can Cypress test elements inside a CodePen preview iframe?

Not reliably when the preview is cross-origin. Cypress documents that it cannot normally communicate with a cross-origin embedded iframe.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Does cy.origin() work with a CodePen iframe?

No. It is for top-level navigation between origins, not an embedded cross-origin frame.

Can Cypress access any iframe?

It can query a same-origin iframe using normal Cypress commands; that does not remove the cross-origin limitation.

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.