I had a question around screen resolution and display settings in Katalon tests.
If a test is created on a machine with a specific screen resolution and display scale (for example 2560×1600 at 200% scaling), does it need to be executed on the same resolution and scale to run reliably?
Could differences in resolution, DPI scaling, or other display settings cause tests to fail (for example due to click interception, element not clickable, or offset issues), even if the locators themselves are correct?
I’m trying to understand whether Katalon tests are resolution-independent as long as locators are stable, or if matching display settings between environments is recommended.
Any clarification or best practices would be appreciated. Thanks!
I don’t think your question makes good sense. You wouldn’t find any immediate YES/NO answer to your question.
Selenium allows users to simulate common activities performed by human as end-user; entering text into fields, selecting drop-down values and checking boxes, and clicking links in documents. Remember, you a human can operate only the web elements which are displayed and visible on browser’s window. A human can not click an invisible button.
Therefore, principally, Selenium requires the target element to be visible on the current view port of the browsers. This is the minimum requirement. If the element is out of the viewport and is NOT visible, then any click action by your test script would fail.
The sreen resolution or display scaling may or may not affect the visibility of each indivisual elements in your target HTML page. It depends on the way how your HTML/CSS/JS is coded. It depends on the way how your test case script is coded. It depends on too many factors so that it’s undeterministic.
Possibly you would want to learn WebUI.scrollToElement keyword
this would bring the target element to be visible in the viewport. You may want to use this defensively so that the view port is scrolled up/down so that the target element is visible before you click it.
Dot Per Inch (DPI) and screen resolution of the platform would affect significantly to the screenshots of browser you take. The following topic is an example how the device pixel ratio affects the screenshot and cause troubles for me.
If your test does something on screenshots, you must be careful screen resolution etc.
in general, no, screen resolution and DPI scaling shouldn’t matter if your katalon tests are using proper DOM-based locators (XPath, CSS, attributes) and standard WebUI keywords
selenium interacts with elements in the DOM, not screen pixels, so tests are mostly resolution-independent
that said, display settings can cause issues if:
you use offset-based actions (clickOffset, drag by offset)
you rely on image-based testing (Sikuli)
the app has responsive layouts (elements move, collapse, or get covered)
high DPI scaling on Windows causes click interception or scroll issues
best practice:
avoid coordinate/image-based actions when possible
use stable locators + proper waits
set a fixed browser window/viewport size in setup (especially for CI)
so you don’t need to perfectly match resolution across machines, unless your tests depend on screen position or visuals
Based on the Katalon documentation, resolution and display settings CAN impact test reliability, but the impact depends on your testing approach:
Key Findings:
For Visual Testing (Image Comparison):
Confirmed Issue: Resolution differences cause test failures even when the UI looks identical
According to the Katalon documentation on visual testing, when baseline and checkpoint images have different resolutions, Katalon detects them as mismatches
This is especially problematic with scrollable elements (calendars, tables) where the visible area changes between runs
For Element Locators (XPath, CSS, etc.):
Generally Resolution-Independent: Stable locators should work across different resolutions
However, offset-based clicks can be affected by resolution/scaling differences
Click interception issues can occur if overlays or other elements appear at different positions due to scaling
Root Cause
The issue is NOT with locators themselves, but with:
Viewport/Screenshot Consistency: WebUI.setViewPortSize() may not apply consistently across environments with different OS display scaling
DPI Scaling Effects: High DPI scaling (like your 200% example) can cause:
Different visible areas in screenshots
Offset-based click coordinates to be inaccurate
Overlay positioning changes
Dynamic Content: Scrollable elements render differently based on available viewport space
Solutions & Best Practices
Solution 1: Standardize Viewport Size (Recommended for Visual Testing)
Step-by-step:
Set an explicit, consistent viewport size before visual testing:
WebUI.setViewPortSize(1920, 1080)
Use Chrome headless mode to ensure consistent viewport behavior across environments:
-browserType="Chrome (headless)"
For scrollable content, ensure elements are fully visible before capturing:
// Scroll element into view
WebDriver driver = DriverFactory.getWebDriver()
WebElement element = WebUiCommonHelper.findWebElement(testObject, 30)
((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView();", element)
Note: Starting from Katalon Studio 10.3.0, offsets are calculated from the center of the element (not top-left), which is more consistent with W3C WebDriver specification.
Use stable XPath/CSS selectors - these are resolution-independent
Visual Testing
Always use WebUI.setViewPortSize() with fixed dimensions (e.g., 1920x1080)
Execution Environment
Run tests in Chrome headless mode for consistent viewport behavior
DPI Scaling
Avoid high DPI scaling (200%) in test execution environments; standardize to 100%
Dynamic Content
Scroll elements into view before capturing screenshots
Click Actions
Use WebUI.waitForElementClickable() before clicking to handle overlay issues
Conclusion
Your tests are NOT fully resolution-independent. While stable locators work across resolutions, visual testing and offset-based clicks are affected by resolution and DPI scaling differences. The best practice is to:
Standardize the execution environment (same resolution, 100% DPI scaling)
Use explicit viewport sizing in your tests
Run in headless mode for consistency across machines