Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallSome links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.
Selenium’s screenshot API captures the browser’s WebDriver context, not the Windows desktop, so it will not include the taskbar. In Java, use Selenium’s TakesScreenshot for the browser and Java AWT’s Robot to capture the visible display area that contains the taskbar. If you need a single image, combine or crop the resulting images afterward.
Why a Selenium screenshot omits the Windows taskbar
A WebDriver screenshot represents the page or browser context controlled by the driver. The Windows taskbar belongs to the operating system, outside that context. Consequently, driver.manage().window().maximize() and fullscreen() change the browser window state but do not make Selenium capture desktop pixels. Selenium’s window documentation describes maximizing as filling the screen without blocking the operating system’s own menus and toolbars: Selenium window interactions.
The Java TakesScreenshot interface provides getScreenshotAs(OutputType<X>) for supported drivers and elements. It follows W3C-conformant behavior, with a best-effort fallback for non-conformant drivers; it is not a Windows desktop capture method. See the Selenium Java API documentation.
Capture the browser and taskbar separately in Java
Use Selenium to save the browser screenshot, then AWT Robot to capture the selected display’s screen rectangle. The following standalone example uses a ChromeDriver. It writes browser.png and desktop-with-taskbar.png as separate files.
#1 Best Overall
- 14" diagonal, 1366x768 resolution, HD BrightView LED, Glossy NON-TOUCH Display
import org.openqa.selenium.OutputType;
import org.openqa.selenium.TakesScreenshot;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import javax.imageio.ImageIO;
import java.awt.AWTException;
import java.awt.GraphicsConfiguration;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
import java.awt.Rectangle;
import java.awt.Robot;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardCopyOption;
public class BrowserAndTaskbarCapture {
public static void main(String[] args) throws IOException, AWTException {
WebDriver driver = new ChromeDriver();
try {
driver.get("https://example.com");
driver.manage().window().maximize();
Path browserPath = Path.of("browser.png");
File browserFile = ((TakesScreenshot) driver)
.getScreenshotAs(OutputType.FILE);
Files.copy(browserFile.toPath(), browserPath,
StandardCopyOption.REPLACE_EXISTING);
GraphicsEnvironment ge =
GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice device = ge.getDefaultScreenDevice();
GraphicsConfiguration config = device.getDefaultConfiguration();
Rectangle screen = config.getBounds();
Robot robot = new Robot(device);
BufferedImage desktopImage = robot.createScreenCapture(screen);
ImageIO.write(desktopImage, "png", new File("desktop-with-taskbar.png"));
} finally {
driver.quit();
}
}
}
This uses Java AWT and Selenium APIs documented by Oracle’s Java SE 25 Robot API. The example assumes the default display is the one you want. It is an API pattern, not a claim that the code was tested in every Windows, driver, or desktop configuration.
What each capture contains
browser.pngis Selenium’s browser-context image. It does not include the taskbar.desktop-with-taskbar.pngis a capture of the chosen display’s visible pixels. It includes the taskbar if the taskbar falls inside that display rectangle and is visible at capture time.
The desktop capture can include other visible windows, the cursor, notifications, or unrelated desktop content. Arrange the desktop deliberately and avoid exposing sensitive material before taking a screen-wide capture.
Choose the right monitor and screen bounds
On a single-monitor machine, getDefaultScreenDevice() is often the intended display. Do not rely on that assumption in a multi-monitor test: identify the GraphicsDevice for the display containing the taskbar or browser, then use that device’s configuration bounds.
Rank #2
- 1.1 GHz (boost up to 2.4GHz) Intel Celeron N5030 Quad-Core
- 4GB DDR4 System Memory; 128GB Solid State Drive
- 11.6" HD (1366 x 768) Multi-Touch Display
- Combo headphone/microphone jack - Noble Wedge Lock slot - HDMI; 2 USB 3.1 Gen 1
- Windows 11 Pro
Oracle documents that multi-screen environments may use a shared virtual coordinate system or independent coordinate systems. Use the selected device’s bounds rather than hard-coding coordinates or assuming that the primary monitor begins at (0, 0). A negative origin can be valid in a shared coordinate layout.
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice[] devices = ge.getScreenDevices();
for (int i = 0; i < devices.length; i++) {
GraphicsDevice device = devices[i];
Rectangle bounds = device.getDefaultConfiguration().getBounds();
System.out.printf("Display %d: %s bounds=%s%n",
i, device.getIDstring(), bounds);
}
After identifying the correct display from its ID and bounds, select that entry from getScreenDevices() and construct new Robot(device). This avoids confusing a browser on one display with a taskbar on another.
Make one combined image only if you need one
The Selenium call and the Robot call produce different images, and they do not automatically align: the browser image may have browser-window dimensions while the desktop image covers an entire display. To make one artifact, decide which result you actually need:
Rank #3
- 256 GB SSD of storage.
- Multitasking is easy with 16GB of RAM
- Equipped with a blazing fast Core i5 2.00 GHz processor.
- If the requirement is proof of the real desktop state, use the Robot desktop image. It already contains the browser and taskbar as visible pixels when both are on the captured display.
- If the requirement is a clean browser image plus a taskbar strip, crop the relevant browser and taskbar regions and compose them with Java image processing. Match scale and placement explicitly; do not assume the two captures have identical dimensions.
- If the requirement is only page content, use the Selenium image and do not add the desktop capture.
A composite made from the two captures is a constructed artifact, not a single Selenium screenshot. Capturing the desktop after a browser capture also creates a timing gap; a notification or window change between calls can make the images represent slightly different moments.
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Compare the capture methods
| Approach | Browser content | Taskbar | Constraint |
|---|---|---|---|
Selenium TakesScreenshot |
Yes | No | Scoped to WebDriver’s browsing context. |
Selenium maximize/fullscreen plus TakesScreenshot |
Yes | No guarantee | Changes window state; does not switch Selenium to desktop capture. |
Java AWT Robot |
Yes, as visible desktop pixels | Yes, when within the captured rectangle and visible | Requires a permission-capable interactive desktop and correct display bounds. |
Run it in the right environment
Use a real interactive desktop
Robot captures screen pixels, so the Java process must be able to access a desktop session. Oracle documents that constructing a Robot can throw AWTException in a headless environment. A headless browser may still support Selenium screenshots, but that does not provide a Windows taskbar for AWT to capture.
Check desktop permissions
Desktop security restrictions can cause SecurityException or undefined returned pixels when capture permission is denied. Run the process in a session where screen capture is permitted, and check your operating-system or execution-environment restrictions when the saved image is blank or incomplete.
Rank #4
- EFFORTLESS EVERYDAY PERFORMANCE: Powered by Intel Celeron N4020 processor and Windows 11 Home system, delivering reliable, low-power efficiency for daily tasks like document editing, email, online classes, and web browsing
- 15.6-INCH FULL HD DISPLAY: Enjoy immersive visuals on the 15.6" FHD (1920x1080) anti-glare screen with micro-edge bezels. Delivers clear details and comfortable viewing for long study sessions, working on spreadsheets, and video playback
- RESPONSIVE MULTITASKING & STORAGE: Built with 4GB LPDDR4 RAM and 128GB eMMC storage for smooth daily essential use. Expand your storage by up to 1TB via the integrated TF card slot to easily store movies, photos, and working files
- ADVANCED CONNECTIVITY: Outfitted with 2x Full-Featured Type-C ports for data transfer, fast charging, and dual-monitor output, alongside 2x USB 3.2 Gen1 ports and a 3.5mm audio jack for complete peripheral compatibility
- LIGHTWEIGHT & SILENT OPERATION: Slim and portable for effortless travel or commuting. Features a 1MP HD webcam for remote meetings, 38Wh battery with 45W Type-C fast charging, and a fanless silent design for peaceful work environments.
Keep the taskbar visible
Robot records what is on screen in the rectangle at the moment of capture. If the taskbar is set to auto-hide, obscured, located on another display, or outside the selected bounds, the resulting image may not show it. Confirm the target display and taskbar state before capture.
Troubleshoot common failures
- The Selenium file has no taskbar. This is expected:
TakesScreenshotis not a desktop capture API. Add a Robot capture for the display. AWTExceptionoccurs. The process may be in a headless environment or lack a usable desktop. Run it in an interactive desktop session; a headless Selenium screenshot cannot substitute for the taskbar.SecurityExceptionoccurs, or the image is blank. Check whether the process is permitted to capture the desktop. Oracle notes that denied capture permission can also result in undefined pixel content.- The wrong monitor appears. The default screen device is not necessarily the monitor you intended. Enumerate
getScreenDevices(), inspect each configuration’s bounds, and use the matching device. - The browser appears but the taskbar does not. The selected rectangle may not include the taskbar, or the taskbar may be hidden or on another monitor. Capture the correct device bounds and ensure the taskbar is visible.
- The browser and desktop files do not line up. They are separate captures with different framing and possibly different capture times. Use the Robot image directly for an authentic desktop view, or explicitly crop, scale, and composite regions if a single composed image is required.
Performance, reliability, and cost considerations
The Selenium and Robot steps each create an image, so keeping both files and composing them adds image I/O and processing beyond a browser-only screenshot. The desktop route is also dependent on an available, visible, permission-enabled session; it is less suitable for headless CI than a browser-context capture. No performance benchmark or universal reliability rate is established for this code pattern, so validate it in the same desktop and monitor arrangement used by your test runner.
For repeatable test artifacts, log the selected device ID and bounds, use a predictable desktop session, and store the two source images before any composition. That makes it possible to distinguish a Selenium page-capture issue from a desktop permissions or monitor-selection issue.
Best Value
- WINDOWS 11 | STABLE PERFORMANCE: Powered by Intel Celeron N4020 processor and Windows 11 system, this laptop delivers stable performance for everyday computing tasks. It supports web browsing, online learning, document editing, email communication, and basic office work with optimized power efficiency, providing a practical and reliable experience for essential daily use for daily use.
- 15.6” FHD IPS DISPLAY: Features a 15.6-inch Full HD IPS display with narrow bezels, offering wider viewing angles and clearer image details compared to standard panels. The improved screen-to-body ratio enhances visual experience for study, reading, document work, and video playback, making it suitable for both productivity and entertainment use.
- 4GB DDR4 + 128GB eMMC STORAGE: Equipped with 4GB DDR4 memory and 128GB eMMC storage for everyday basics such as browsing, documents, email, and online learning platforms. The built-in TF card slot supports storage expansion up to 1TB, giving you more flexibility for files, photos, videos, and daily documents. TF card not included.
- CONNECTIVITY & PORTS: Includes 1× TF card slot, 2× USB 3.2 Gen1 ports, and 2× full-featured Type-C ports (USB 3.2 Gen1). The Type-C ports support data transfer, charging, and video output, enabling flexible connection with external devices such as monitors, storage, and peripherals for daily work and study use.
- LIGHTWEIGHT DESIGN | ONLINE COMMUNICATION: Designed with a slim, portable profile, this laptop is easy to carry for school, commuting, and travel. A built-in 1MP front camera supports online classes, video meetings, remote communication, and everyday conferencing. The 3300mAh battery works with the low-power system design to support practical daily use, while thermal optimization helps maintain quieter operation during extended tasks.
Or skip the browser setup
If you need a clean webpage image or PDF rather than a literal Windows desktop image with taskbar, ScreenshotNeo is a website screenshot API and MCP server. It cannot capture the Windows taskbar because it captures website output, not desktop pixels. One GET request returns an image or PDF; see the ScreenshotNeo API documentation.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp
ScreenshotNeo removes cookie/consent banners, newsletter popups, and chat widgets before capture; each cleanup step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits cost nothing, with response headers indicating the page verdict and billing status. Its MCP server includes take_screenshot, get_page_info, and capture_pdf for AI agents. The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 screenshots. Those are ScreenshotNeo plan allowances and prices, not a substitute for desktop capture. Sign up for 1,000 free screenshots a month with no card.
Frequently Asked Questions
Can Selenium capture the entire Windows desktop?
No. Selenium’s screenshot method captures its WebDriver browsing context. Use Java AWT Robot or another desktop capture mechanism for desktop pixels.
Will fullscreen mode make the taskbar appear in a Selenium screenshot?
No. Fullscreen changes browser window state; it does not turn the Selenium screenshot into a desktop capture.
Can ScreenshotNeo include the Windows taskbar?
No. ScreenshotNeo captures website output, not the Windows desktop. Use Robot when the taskbar must be present.
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.

