Questions tagged [selenium-webdriver]

Selenium WebDriver provides the WebDriver API for controlling browsers in different programming languages ("language bindings"). When using this tag, also add a tag for the programming language you are using.

Selenium WebDriver is an API framework that allows communication and control of most web browsers. WebDriver, as it is often called, focuses mostly on user interaction, preventing actions a typical "user" would not be able to do (e.g. setting element values directly and interacting with elements that are hidden by menus or are display: none). However, it does allow direct JavaScript interaction, allowing development even in those areas.

WebDriver has gained popularity due to its support for almost all major browsers, its availability for many popular development languages, and its active development and support of the core framework.

Latest version of the W3C WebDriver specification.

Selenium WebDriver currently supports the following drivers:

Related tags:


Reference Links

54467 questions
651
votes
19 answers

Get HTML source of WebElement in Selenium WebDriver using Python

I'm using the Python bindings to run Selenium WebDriver: from selenium import webdriver wd = webdriver.Firefox() I know I can grab a webelement like so: elem = wd.find_element_by_css_selector('#my-id') And I know I can get the full page source…
Chris W.
  • 37,583
  • 36
  • 99
  • 136
544
votes
51 answers

How can I take a screenshot with Selenium WebDriver?

Is it possible to take a screenshot using Selenium WebDriver? (Note: Not Selenium Remote Control)
474
votes
52 answers

Debugging "Element is not clickable at point" error

I see this only in Chrome. The full error message reads: "org.openqa.selenium.WebDriverException: Element is not clickable at point (411, 675). Other element would receive the click: ..." The element that 'would receive the click' is to the side…
user1591169
  • 4,741
  • 3
  • 14
  • 3
431
votes
11 answers

Is there a way to get element by XPath using JavaScript in Selenium WebDriver?

I am looking for something like: getElementByXpath(//html[1]/body[1]/div[1]).innerHTML I need to get the innerHTML of elements using JS (to use that in Selenium WebDriver/Java, since WebDriver can't find it itself), but how? I could use ID…
pMan
  • 8,808
  • 11
  • 32
  • 35
379
votes
13 answers

How do I find an element that contains specific text in Selenium WebDriver (Python)?

I'm trying to test a complicated JavaScript interface with Selenium (using the Python interface, and across multiple browsers). I have a number of buttons of the form:
My Button
I'd like to be able to search for buttons based on "My…
josh
  • 9,038
  • 8
  • 31
  • 37
351
votes
12 answers

Difference between webdriver.Dispose(), .Close() and .Quit()

What is the difference between these Webdriver.Close() Webdriver.Quit() Webdriver.Dispose() Which one to be used and when?
Puran Joshi
  • 3,656
  • 2
  • 13
  • 9
348
votes
49 answers

WebDriverException: unknown error: DevToolsActivePort file doesn't exist while trying to initiate Chrome Browser

I am trying to launch chrome with an URL, the browser launches and it does nothing after that. I am seeing the below error after 1 minute: Unable to open browser with url: 'https://www.google.com' (Root cause:…
322
votes
18 answers

How to select a drop-down menu value with Selenium using Python?

I need to select an element from a drop-down menu. For example: