Next-Gen App & Browser Testing Cloud
Trusted by 2 Mn+ QAs & Devs to accelerate their release cycles

The browser window that WebDriver opens is a normal, fully interactive browser, so you can inspect any WebElement in it, but not with Firebug. Firebug was discontinued in 2017 and no longer works with modern Firefox. Use the built-in DevTools instead: right-click the element and choose Inspect, or press F12, exactly as you would in a manually opened browser.
The only catch is timing: WebDriver closes the window when the test ends, so you need to pause execution to inspect it live. This guide covers how to do that and which modern tools replace Firebug and FirePath.
Firebug was a Firefox add-on used for years to inspect the DOM and, with the FirePath companion, to build and test XPath and CSS locators for Selenium. Mozilla ended Firebug in 2017 and folded its capabilities into the native Firefox Developer Tools, and the shift to WebExtensions broke the old XPI installs entirely. So any tutorial that tells you to load firebug.xpi into the profile WebDriver launches is outdated; the browser DevTools now do everything Firebug did and more.
Because WebDriver drives a real browser, DevTools are already available in the window it opens. The challenge is that the test finishes in seconds and calls driver.quit(), closing the window before you can look. Pause the run with a breakpoint or a temporary sleep so the session stays open:
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class InspectDemo {
public static void main(String[] args) throws InterruptedException {
WebDriver driver = new ChromeDriver();
driver.get("https://www.lambdatest.com/selenium-playground/");
// Pause so the browser stays open and you can right-click and Inspect,
// or press F12 to open DevTools on the live DOM.
Thread.sleep(30000);
driver.quit();
}
}With the window held open, right-click the target element and choose Inspect. DevTools highlights the matching node, and from the context menu you can Copy the CSS selector or XPath to paste straight into your locator. Practice against the Selenium Playground to build reliable locators.
For a deeper reference on building robust selectors, see the TestMu AI guides on locators in Selenium WebDriver and XPath in Selenium, plus the WebDriver learning hub.
You do not always need a visual tool. Once you have located an element, WebDriver can read its properties programmatically, which is ideal for debugging inside the test itself:
from selenium import webdriver
from selenium.webdriver.common.by import By
driver = webdriver.Chrome()
driver.get("https://www.lambdatest.com/selenium-playground/")
element = driver.find_element(By.LINK_TEXT, "Simple Form Demo")
# Inspect the element's attributes and state from code
print(element.get_attribute("href"))
print(element.text)
print(element.is_displayed())
driver.quit()Local DevTools inspection only covers the one browser on your machine, yet locators can behave differently across engines. When you run Selenium on TestMu AI, every session is recorded with video, step screenshots, and full DOM, console, and network logs, so you can inspect exactly what an element looked like even though the browser ran remotely. The same suite executes cross-browser testing across 3000+ real browsers and devices in parallel, letting you confirm a locator resolves correctly on Chrome, Firefox, Safari, and Edge at once instead of debugging them one at a time.
Yes, you can inspect a WebElement in the browser WebDriver opens, just not with Firebug, which has been dead since 2017. Pause the session so the window stays open, use the built-in DevTools or SelectorsHub to grab reliable selectors, and read element state from code with get_attribute() when you need to debug in the test. To inspect and validate locators across every major browser at once, run your Selenium suite on a real-browser cloud grid.
No. Firebug was discontinued in 2017 and is not compatible with modern Firefox. Its features were merged into the built-in Firefox Developer Tools, which you open with F12. Any tutorial that tells you to install the Firebug XPI is outdated.
Yes. The window WebDriver launches is a normal browser, so you can right-click any element and choose Inspect, or press F12 to open DevTools, exactly as you would in a manually opened browser. Add a breakpoint or Thread.sleep to keep the window open long enough to inspect.
FirePath is deprecated. Use the browser DevTools element picker, which lets you copy a CSS selector or XPath directly, or install SelectorsHub, a modern extension for Chrome and Firefox that generates and validates relative XPath and CSS locators.
WebDriver calls driver.quit() at the end of the test, which closes the window. To inspect interactively, set a breakpoint before quit, comment out quit temporarily, or pause execution so the session stays open while you examine the DOM.
Locate the element, then call getAttribute() in Java or get_attribute() in Python to read values like id, class, href, or value. Combined with getText() and isDisplayed(), this lets you inspect element state programmatically during a run.
Yes. Cloud grids record video, capture step-by-step screenshots, and expose full network and console logs for every session, so you can inspect what happened even though the browser ran remotely and there is no local window to open DevTools on.
KaneAI - Testing Assistant
World’s first AI-Native E2E testing agent.

TestMu AI forEnterprise
Get access to solutions built on Enterprise
grade security, privacy, & compliance