What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
To capture a CEF application’s screen with Selenium, launch the CEF executable with a Chromium remote-debugging port, point ChromeDriver at that executable, create a WebDriver session, wait for the application state you need, and call Selenium’s screenshot API. Use a current, mutually compatible CEF/Chromium build, ChromeDriver, and Selenium binding; the older CEF walkthrough commonly cited online is a Windows historical example, not a current version recipe.
How CEF, ChromeDriver and Selenium fit together
Chromium Embedded Framework (CEF) puts a Chromium browser inside a native application. Your test is therefore not attaching to an ordinary Chrome window. The application must expose Chromium’s DevTools remote-debugging endpoint, and ChromeDriver must be configured to start or control that CEF binary. The CEF project describes ChromeDriver and Selenium as tools for automated testing of Chromium-based applications. It also explains that ChromeDriver communicates with the application through the DevTools remote debugging protocol, enabled with the --remote-debugging-port=XXXX command-line argument.
There are two separate jobs:
- Connection: start the CEF program with a debugging port and configure
ChromeOptionsto use the program’s executable. - Capture: after navigation and rendering reach the required state, ask Selenium for a screenshot of the current browsing context or of one element.
Keep the CEF executable, its embedded Chromium version, ChromeDriver and Selenium binding aligned. The official CEF guide’s sample was tested on Windows with ChromeDriver 2.14 and Selenium Server 2.44.0, and says the remote-debugging-port argument became required starting with ChromeDriver 2.41. Those numbers are historical documentation details; do not install them as a recommendation for a new project.
Prerequisites and compatibility checks
What you need
- A CEF application that accepts command-line arguments and uses a Chromium build compatible with your ChromeDriver.
- ChromeDriver available on
PATH, or an explicit path supplied through your Selenium binding. - Selenium for your chosen language.
- A test account, local fixture or deterministic URL that the CEF application can open.
- A writable directory for image files.
What to verify before debugging screenshots
- Run the CEF executable manually with a unique, unused local port such as
12345. - Confirm that the application remains open and that its browser content loads when started with that argument.
- Check the versions of the embedded Chromium, ChromeDriver and Selenium package. The sources do not provide a current cross-version support matrix, so validate the combination used by your project.
- Run a minimal WebDriver navigation before adding waits, selectors or screenshot code. A failure to create a session is a connection or compatibility problem, not an image-format problem.
Launch the CEF application for WebDriver
Your CEF program must receive the remote-debugging flag when it starts. The exact executable name and command-line parser depend on the application. A conceptual Windows launch looks like this:
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →#1 Best Overall
- Compact Mouse: With a comfortable and contoured shape, this Logitech ambidextrous wireless mouse feels great in either right or left hand and is far superior to a touchpad
- Durable and Reliable: This USB wireless mouse features a line-by-line scroll wheel, up to 1 year of battery life (2) thanks to a smart sleep mode function, and comes with the included AA battery
- Universal Compatibility: Your Logitech mouse works with your Windows PC, Mac, or laptop, so no matter what type of computer you own today or buy tomorrow your mouse will be compatible
- Plug and Play Simplicity: Just plug in the tiny nano USB receiver and start working in seconds with a strong, reliable connection to your wireless computer mouse up to 33 feet / 10 m (5)
- Better than touchpad: Get more done by adding M185 to your laptop; according to a recent study, laptop users who chose this mouse over a touchpad were 50% more productive (3) and worked 30% faster (4)
MyCefApp.exe --remote-debugging-port=12345
If your application starts its browser subprocess internally, pass the argument through the application’s supported command-line mechanism rather than trying to add it after startup. Use a different port for parallel test processes, and restrict the debugging endpoint to a trusted local environment; a remote-debugging port exposes browser control.
The CEF project’s Java illustration uses ChromeOptions, calls setBinary with the CEF executable, adds remote-debugging-port=12345, and constructs a ChromeDriver with those options. The same arrangement applies conceptually in other Selenium bindings.
Java: complete Selenium capture example
This example follows the CEF project’s documented setup pattern. Replace the paths, executable name and URL with values from your application. It saves a full current-context image and an element image.
import java.nio.file.Path;
import java.nio.file.Paths;
import java.time.Duration;
import org.openqa.selenium.By;
import org.openqa.selenium.OutputType;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
public class CefScreenshot {
public static void main(String[] args) throws Exception {
ChromeOptions options = new ChromeOptions();
options.setBinary("C:\apps\MyCefApp\MyCefApp.exe");
options.addArguments("--remote-debugging-port=12345");
ChromeDriver driver = new ChromeDriver(options);
try {
driver.manage().timeouts().pageLoadTimeout(Duration.ofSeconds(60));
driver.get("https://example.test/dashboard");
WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(30));
var panel = wait.until(ExpectedConditions.visibilityOfElementLocated(
By.cssSelector("[data-testid='dashboard-ready']")));
Path pageShot = Paths.get("artifacts/dashboard.webp");
driver.getScreenshotAs(OutputType.FILE)
.renameTo(pageShot.toFile());
Path elementShot = Paths.get("artifacts/dashboard-panel.png");
panel.getScreenshotAs(OutputType.FILE)
.renameTo(elementShot.toFile());
} finally {
driver.quit();
}
}
}
Use a proper file-copy operation in production if you need to check the return value from renameTo. Selenium’s screenshot endpoint returns Base64-encoded image data internally; the binding’s OutputType.FILE writes a file for you. The current browsing-context call captures the browser view represented by the session. The element call limits the image to the selected element.
Recommended Free Tools
Rank #2
- The next-generation optical HERO sensor delivers incredible performance and up to 10x the power efficiency over previous generations, with 400 IPS precision and up to 12,000 DPI sensitivity
- Ultra-fast LIGHTSPEED wireless technology gives you a lag-free gaming experience, delivering incredible responsiveness and reliability with 1 ms report rate for competition-level performance
- G305 wireless mouse boasts an incredible 250 hours of continuous gameplay on just 1 AA battery; switch to Endurance mode via Logitech G HUB software and extend battery life up to 9 months
- Wireless does not have to mean heavy, G305 lightweight mouse provides high maneuverability coming in at only 3.4 oz thanks to efficient lightweight mechanical design and ultra-efficient battery usage
- The durable, compact design with built-in nano receiver storage makes G305 not just a great portable desktop mouse, but also a great laptop travel companion, use with a gaming laptop and play anywhere
Python: current page and element screenshots
Python’s binding exposes the same operations with save_screenshot and an element’s screenshot method.
from pathlib import Path
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
options = Options()
options.binary_location = r"C:appsMyCefAppMyCefApp.exe"
options.add_argument("--remote-debugging-port=12345")
driver = webdriver.Chrome(options=options)
try:
driver.get("https://example.test/dashboard")
ready = WebDriverWait(driver, 30).until(
EC.visibility_of_element_located((By.CSS_SELECTOR, "[data-testid='dashboard-ready']"))
)
Path("artifacts").mkdir(exist_ok=True)
driver.save_screenshot("artifacts/dashboard.png")
ready.screenshot("artifacts/dashboard-panel.png")
finally:
driver.quit()
If your CEF launcher must run separately, start it with --remote-debugging-port=12345 first and configure the driver to attach according to your binding and driver version. Do not assume that a generic Chrome attach recipe works unchanged for every CEF build.
Equivalent calls in C#, Ruby and JavaScript
Selenium documents screenshot examples for Java, Python, C#, Ruby and JavaScript. The names vary slightly, but the distinction is consistent: a driver-level screenshot captures the current context, while an element-level method captures one element.
- C#: use
driver.TakeScreenshot().SaveAsFile(...)andelement.GetScreenshot().SaveAsFile(...). - Ruby: use
driver.save_screenshot(...)and the element screenshot API provided by the Ruby binding. - JavaScript: use the WebDriver screenshot method, which returns encoded image data that you can write to a file.
Consult the API reference for the exact method signature of the version installed in your project. The evidence does not establish that every CEF, ChromeDriver and Selenium combination implements every screenshot operation identically.
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 matchRank #3
- Compact Mouse: With a comfortable and contoured shape, this Logitech ambidextrous wireless mouse feels great in either right or left hand and is far superior to a touchpad
- Durable and Reliable: This USB wireless mouse features a line-by-line scroll wheel, up to 1 year of battery life (2) thanks to a smart sleep mode function, and comes with the included AA battery
- Universal Compatibility: Your Logitech mouse works with your Windows PC, Mac, or laptop, so no matter what type of computer you own today or buy tomorrow your mouse will be compatible
- Plug and Play Simplicity: Just plug in the tiny nano USB receiver and start working in seconds with a strong, reliable connection to your wireless computer mouse up to 33 feet / 10 m (5)
- Better than touchpad: Get more done by adding M185 to your laptop; according to a recent study, laptop users who chose this mouse over a touchpad were 50% more productive (3) and worked 30% faster (4)
Wait for the image you actually want
A successful navigation event is not proof that the final pixels are ready. Single-page applications may fetch data after navigation, images may decode later, and animations can leave a half-rendered frame. Wait for an application-specific signal such as a visible selector, a status attribute, a known text value, or a short, justified delay after the signal. Prefer a deterministic selector over a fixed sleep.
Useful readiness checks
- A
data-testidor other stable element appears. - A loading element disappears.
- A page-specific status changes to “ready”.
- An image’s
completeproperty is true and its natural width is nonzero. - Your test has finished the click, form submission or route change that produces the target state.
CefSharp’s OffScreen API reference warns that a screenshot can capture a loading render and recommends waiting until the page is loaded, for example through FrameLoadEnd or a suitable heuristic. That warning concerns CefSharp’s own capture API, but the underlying rendering issue is relevant when deciding when a Selenium capture is meaningful.
Full-page, viewport and element capture decisions
Current browsing context
Use the driver screenshot when you need what the current browser context displays. Treat the result as the context exposed by your driver and CEF version; do not assume every combination provides identical full-page stitching behavior.
One element
Use an element screenshot for a card, report, canvas or test fixture. Scroll the element into view if necessary, wait for its visibility, and ensure overlays are not covering it. Element bounds can change when fonts or images finish loading, so take the image after those resources are ready.
Rank #4
- Computer mouse for easily navigating a computer interface; click, scroll, and more
- USB-A wired connection; if existing device only supports USB-C, an additional adapter will be required
- High-definition (1000 dpi) optical tracking ensures responsive cursor control for precise tracking and easy text selection
- 3 buttons offer effortless fingertip control
- Plug-and-go ready for instant use
Long documents
If a full document is required, verify what your installed driver supports rather than assuming that a viewport screenshot is a stitched full page. A reliable fallback is to capture the required sections or resize the browser before capture, provided your application and test permit it.
Common failures and fixes
| Symptom | Likely cause | Fix |
|---|---|---|
| SessionNotCreatedException | ChromeDriver cannot work with the CEF/Chromium build, or the binary path is wrong. | Check the executable path and align driver and embedded Chromium versions. The old CEF tutorial’s versions are not a current compatibility guarantee. |
| Cannot connect to port | The CEF process was not started with the debugging argument, the port is occupied, or a firewall blocks it. | Start with a free local port, confirm the process remains alive, and use the same port in your options. |
| Chrome opens instead of the CEF app | setBinary or binary_location points to a normal Chrome installation. |
Set the path to the CEF application’s executable and verify that it accepts the remote-debugging flag. |
| Blank or partially rendered image | Capture occurred during navigation, asynchronous rendering or animation. | Wait for a stable application-specific condition, then capture; avoid relying only on a navigation return. |
| NoSuchElementException | The selector is wrong, the frame is different, or content has not loaded. | Wait for the element, inspect the current URL and frame structure, and switch to the correct frame when applicable. |
| Element image is clipped | The element is outside the viewport, changing size, or covered by an overlay. | Scroll it into view, wait for stable dimensions, close the overlay in the test, and retry. |
| File is missing or empty | The output directory does not exist or the process lacks write permission. | Create the directory first, use an absolute path in CI, and check the binding’s save result. |
Reliability and performance practices
- Allocate a unique debugging port per parallel worker.
- Keep one driver session for a coherent workflow, but restart it after a crash rather than reusing a broken session.
- Save screenshots as test artifacts with a case identifier and timestamp.
- Capture only after the assertion state is reached; unnecessary images increase storage and transfer time.
- Disable animations in test CSS when that is under your application’s control, or wait for their completion.
- Use explicit timeouts for page loads and readiness conditions, and report which condition timed out.
- Run the same capture on the operating system and display scale used by the test. Font rasterization, window size and device-pixel ratio affect pixels.
Alternative for CefSharp OffScreen applications
If the application is built with CefSharp OffScreen and you need a browser-control capture rather than WebDriver automation, the framework’s own API may be a better integration point. In the CefSharp version family documented as 99.2.120, CaptureScreenshotAsync is the capture method and older ScreenshotAsync is marked obsolete. The reference says the older method waits for a next rendering and that bitmap dimensions follow the browser size previously set. Wait for FrameLoadEnd or an equivalent readiness heuristic before calling the capture method.
This route is framework- and version-specific. It does not create a Selenium session, so it is unsuitable when the same test must locate elements, click controls and assert through WebDriver.
Or skip the browser setup
ScreenshotNeo provides a website screenshot API when you need an image or PDF from a URL without maintaining a CEF process, ChromeDriver and Selenium session. A single GET request returns PNG, JPEG, WebP or PDF. It accepts cookie and consent banners like a visitor, then removes more than 60 known consent platforms, newsletter popups and chat widgets before capture; each cleanup step can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads and cache hits are not billed, and the response identifies the result with X-Page-Verdict and X-Billed headers.
For API parameters and all 63 capture options, see the ScreenshotNeo documentation.
Best Value
- 【Plug and Play for Home/Office/School】The wireless computer mouse features 2.4GHz connectivity, delivering a stable, interference-free connection up to 32ft. Designed for 𝐦𝐞𝐝𝐢𝐮𝐦 𝐭𝐨 𝐥𝐚𝐫𝐠𝐞 𝐬𝐢𝐳𝐞𝐝 𝐡𝐚𝐧𝐝𝐬, it ensures comfortable use all day. Simply plug in the USB-A receiver for instant pairing—no drivers needed. 📌📌 If the mouse isn’t suitable, place the USB receiver in the battery compartment and return both.
- 【3 Levels Adjustable DPI】This travel USB mouse offers 3 adjustable DPI settings (800, 1200, 1600), allowing you to customize sensitivity for precise design work. Effortlessly switch to match your task and elevate your productivity. 📌 Please remove the film at the bottom of the mouse before use.
- 【Effortless Browsing】Equipped with forward and backward buttons, this computer mice streamlines your workflow, making it easy to navigate through web pages and files with a simple click. 📌Side button does not work on Mac.
- 【Visible Indicator Light】 The pc mouse features a visual indicator for DPI levels and low battery alerts. The red light flashes once for 800 DPI, twice for 1200 DPI, and three times for 1600 DPI. When the battery level is below 10%, the light flashes red until the mouse is completely out of power.
- 【Click to Wake】With smart sleep mode, it saves power by standby after 10 inactive minutes, just 2-3 clicks to wake. This efficient design delivers 3x longer battery life than motion-wake mice. Engineered for durability, its buttons and scroll wheel are tested for 10 million clicks, ensuring long-term reliability and consistent performance.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
Options include full-page capture with lazy images loaded, CSS-selector element capture, dark mode, 12 device presets or a custom viewport, retina scale, PDF paper settings, custom CSS and JavaScript, clicks before capture, selector waits, delays or network-idle waits, request and resource blocking, headers, cookies, user agent, Authorization, timezone, geolocation, transparent backgrounds, resizing, chosen cache TTLs, signed links, asynchronous jobs with signed webhooks, bulk capture of up to 100 URLs per call, a usage API and an OpenAPI specification. An MCP server exposes take_screenshot, get_page_info and capture_pdf for Claude, Cursor and other MCP clients.
The Free plan includes 1,000 screenshots per month without a card. Paid plans start at $5 for 3,000 shots; every feature is available on every plan. Create a free ScreenshotNeo account to try the API.
Decision checklist
- Choose Selenium through ChromeDriver when the screenshot is part of a test that must navigate, locate elements or interact with the CEF application.
- Choose CefSharp OffScreen capture when your own CefSharp browser control is the integration point and WebDriver is unnecessary.
- Choose an HTTP screenshot service when the target is a reachable URL and you want to remove local browser setup and process management.
- In every case, define the exact readiness condition first; a technically successful screenshot can still be the wrong frame.
Frequently Asked Questions
How do I use Selenium with a CEF application?
Start the CEF executable with a free --remote-debugging-port, configure ChromeOptions to use that executable, create ChromeDriver, navigate, wait for an application-specific ready condition, and call the driver or element screenshot method.
Free tools Windows power users keep installed
One-click scans. No signup required.
Can Selenium capture a specific CEF element instead of the whole page?
Yes. Locate the element after it is visible and stable, then use the element screenshot API exposed by your Selenium language binding.
Are the CEF tutorial’s ChromeDriver 2.14 and Selenium 2.44.0 versions current?
No. They are versions reported by an older Windows walkthrough. Match your installed CEF/Chromium, ChromeDriver and Selenium versions and validate that combination.
When should I use CefSharp’s screenshot API instead?
Use it when your application is built with CefSharp OffScreen and capture belongs directly to the browser control rather than to a WebDriver test. In the documented 99.2.120 family, use CaptureScreenshotAsync and wait for page readiness.
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.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Scan for outdated or missing drivers - takes under a minute3Repair Windows errors before they cause bigger problems




