Call is_displayed() in Python or isDisplayed() in Java and JavaScript on a Selenium WebElement to ask whether Selenium considers the element displayed in the current browsing context. The result is a useful state check, not proof that a click or keyboard action will succeed. If the page is still changing, wait for visibility instead of checking once.
Call the method on a located element
First locate the element using a locator suitable for your page, then call the method from your Selenium language binding. The method returns a Boolean in Python and Java; in JavaScript it returns a promise that resolves to a Boolean.
Python
from selenium.webdriver.common.by import By
button = driver.find_element(By.ID, "submit")
if button.is_displayed():
print("Selenium reports the element as displayed")
Python spells the method is_displayed(). Its documented return type is bool: Python WebElement API.
Java
WebElement button = driver.findElement(By.id("submit"));
if (button.isDisplayed()) {
System.out.println("Selenium reports the element as displayed");
}
Java spells the method isDisplayed(), which returns boolean: Java WebElement API.
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 reinstall#1 Best Overall
JavaScript
const button = await driver.findElement(By.id('submit'));
const displayed = await button.isDisplayed();
console.log(displayed);
In JavaScript, await the returned Promise<boolean>: JavaScript WebElement API.
What the result means—and what it does not
Selenium describes this as checking whether the connected element is displayed in the current browsing context. Its documentation also cautions that displayedness is not fully defined by the W3C WebDriver specification; Selenium uses a JavaScript-based approximation because every possible condition is difficult to specify. Treat true as Selenium’s displayedness assessment, not a guarantee that every user would perceive the element as visible in every circumstance. See Selenium’s element information documentation (page modified April 17, 2026).
Rank #2
Displayedness is also different from readiness for interaction. Selenium performs additional checks for actions. It may scroll an element into view, but an element that is not displayed or not interactable can cause an element-not-interactable error. If the click’s center is covered by another element, the click can instead fail with an element-click-intercepted error. Details are in Selenium’s interaction documentation.
Wait for visibility when the page is dynamic
A direct call tells you the current state at that moment. It does not wait for a hidden element to appear. In Python, use WebDriverWait with visibility_of_element_located when the page may need time to render:
Rank #3
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait
button = WebDriverWait(driver, 10).until(
EC.visibility_of_element_located((By.ID, "submit"))
)
The 10-second timeout is an illustrative value, not a performance recommendation. The Python API reference describes visibility as presence in the DOM plus width and height greater than zero. The related element_to_be_clickable condition requires the element to be visible and enabled; neither condition promises that another element will not obstruct the click. These details are documented in the Selenium Python 4.50.0 expected-conditions reference: expected conditions API. Match the reference and code to the Selenium version installed in your project.
Choose the check that matches the task
| Need | Use | What it establishes |
|---|---|---|
| Check state right now | element.is_displayed() or the binding’s equivalent |
Selenium’s current displayedness assessment. |
| Wait for a located element to become visible (Python) | visibility_of_element_located(locator) with WebDriverWait |
The element is present and has non-zero width and height, per the Python expected-condition documentation. |
| Wait until a control is visible and enabled (Python) | element_to_be_clickable(locator) with WebDriverWait |
Visibility and enabled state; it does not establish that the eventual click center is unobstructed. |
| Perform a click or keyboard action | Use Selenium’s interaction command and handle its interaction errors | The command applies interaction checks beyond a standalone displayedness check. |
Troubleshoot common outcomes
- The method returns false: the element may exist in the DOM but not currently meet Selenium’s displayedness assessment. If it should appear after a page transition or asynchronous update, wait for visibility rather than making a single immediate check.
- Finding the element fails before the method runs: the locator did not return a
WebElement. Check that the locator matches the current page and that the relevant content has loaded; a displayedness method cannot be called until an element has been located. - The method returns true but clicking fails: displayedness alone does not prove interactability. Check whether the control is enabled and whether another element covers the click center; consult Selenium’s interaction errors and use a suitable wait for the state you need.
- The check seems inconsistent on a changing page: the direct call observes one instant. Replace repeated immediate checks with an explicit wait for the desired condition.
- The example does not match your codebase: use the spelling and return behavior for your binding, and verify against the API reference version matching your installed Selenium package.
Or skip the browser setup
If your goal is to capture a clean image of a page rather than inspect an element in a Selenium test, ScreenshotNeo can return a screenshot or PDF with one GET request. It accepts cookie or consent banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits cost nothing, and response headers identify the page verdict and billing status. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents.
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 per month with no card; paid plans start at $5 for 3,000. Sign up free for 1,000 screenshots a month, with no card required.
Rank #4
Frequently Asked Questions
Can isDisplayed() return null?
No. The documented result is a Boolean in Java and Python, and a promise resolving to a Boolean in JavaScript.
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Fix the driver behind crashes, sound loss and screen glitches3Clear out junk files and repair common Windows errorsDoes isDisplayed() check whether an element is enabled?
No. Enabled state is separate; Python’s clickable expected condition combines visibility with enabled state.
Quick Recap
Best Value
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.




