In a Selenium Java test, set the page viewport when you call eyes.open: driver = eyes.open(driver, "Applitools", "Test Web Page", new RectangleSize(1024, 768));. The dimensions describe the page’s inner content area, not the full browser window. Use the WebDriver returned by eyes.open for the rest of the test.
Set the viewport in eyes.open
Applitools’ Selenium Java example imports com.applitools.eyes.RectangleSize and passes a width and height to eyes.open. Add the import and call at test setup:
import com.applitools.eyes.RectangleSize;
// Start visual testing with browser viewport set to 1024x768.
driver = eyes.open(driver, "Applitools", "Test Web Page", new RectangleSize(1024, 768));
The example’s 1024-by-768 size is illustrative, not a required default. Replace it with dimensions that represent the layout your test is intended to verify. Applitools’ example is documented at its viewport guide.
Keep the returned driver
Assign the result of eyes.open back to driver, then use that driver in subsequent navigation and test actions. The SDK may return a driver instance configured for the visual test; continuing with the original reference would not follow the documented example.
Free tools Windows power users keep installed
One-click scans. No signup required.
#1 Best Overall
What the width and height mean
RectangleSize(width, height) specifies the browser’s client viewport—the page content area available to the site. It does not specify the outer browser window, which also includes browser chrome such as tabs and toolbars. Applitools calculates the outer window size needed to produce the requested content area. See Applitools’ viewport sizing guidance.
This distinction matters when comparing the setting with Selenium’s ordinary window-size controls: changing the outer window dimensions does not necessarily yield the same inner page dimensions, because browser chrome takes up space. Setting a target viewport at the beginning of the test makes the visual check more repeatable when responsive layouts depend on available page width or height.
Rank #2
Choose dimensions for the layouts you need to test
Pick a size based on the application’s intended responsive breakpoints and the screens you need to validate. A single fixed viewport helps repeat runs under consistent conditions; testing more than one size can exercise layout changes at different widths. Applitools uses 1000 by 600 as a generic example in its discussion of cross-browser testing, not as a universal recommendation: Cross-browser testing with Applitools.
If you need to discover a useful size, inspect the current viewport in the browser’s JavaScript console or use a viewport-size page, as described in Applitools’ viewport-size article. Use the resulting dimensions as a starting point, then choose test sizes that correspond to the application’s actual layouts.
Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Clear out junk files and repair common Windows errors3Fix the driver behind crashes, sound loss and screen glitchesRank #3
Grid and emulated-device tests use environment configuration
Do not assume the local Selenium eyes.open example configures every Applitools execution mode. The Java Ultrafast Grid quickstart describes browser and emulated-device environments separately, using Configuration.addBrowsers with entries such as DesktopBrowserInfo and ChromeEmulationInfo. Follow the current guide for the SDK and execution flow you are using: Java Ultrafast Grid quickstart. Applitools publishes guides for multiple SDK families, including Selenium and Playwright, so don’t transfer syntax between bindings without checking that SDK’s guide: Applitools documentation.
Troubleshoot viewport sizing failures
If eyes.open cannot set the requested viewport, Applitools says the SDK throws an exception and stops before the test continues. Check these causes:
Rank #4
- Requested area exceeds available screen space. The outer browser window needed to create the requested content area may be larger than the available display. Try a smaller viewport or run in an environment with more screen area.
- Viewport is below the browser’s minimum size. Raise the requested width or height to a size the browser supports.
- Appium is targeting a mobile device. The mobile window may already be maximized, so requesting another viewport size can fail. Use the device/emulation configuration appropriate to that test rather than assuming desktop resizing behavior.
- Windows display zoom is not 100%. Applitools identifies non-100% display zoom as a possible cause of incorrect size calculation; set Windows display scaling to 100% and retry.
These failure causes and behavior are described in Applitools’ viewport-size troubleshooting guide.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Or skip the browser setup
If the goal is to obtain a website screenshot rather than run an Applitools visual test, ScreenshotNeo offers a one-request screenshot API. For example, use cURL:
Best Value
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 parameters and response details. ScreenshotNeo accepts cookie or consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each cleanup step can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and responses identify the page verdict and billing status in headers. It also provides an MCP server with screenshot, page-info, and PDF-capture tools for AI agents. The Free plan includes 1,000 screenshots per month without a card; paid plans start at $5 for 3,000 screenshots.
Sign up for ScreenshotNeo’s free plan to get 1,000 screenshots a month with no card.
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.




