Questions tagged [webdriver]

WebDriver is an API for controlling web browsers, imitating a real user. It's mostly used for automated tests. WebDriver has multiple language bindings and drivers (allowing to control various browsers). If your question is specific to one of them, make sure to also include the appropriate tag.

WebDriver is an API that allows programs or scripts to introspect into, and control the behavior of, a web browser. It is primarily intended for allowing tests that automate a browser.

The WebDriver API is implemented, natively or via add-ons, for many browsers. The Selenium tools suite provides several WebDriver implementations, e.g. for Firefox or Internet Explorer. Other WebDriver implementations are developed by the browser projects directly, e.g. ChromeDriver for Chrome, or Ghost Driver for PhantomJS.

The WebDriver API specifies a wire protocol which is used for the communication between a WebDriver client and the browser. Clients do not speak the wire protocol directly, they use "language bindings" of the WebDriver API for the respective programming language. The wire protocol is used by the Selenium Grid to pass API commands across network.

There are language bindings of the WebDriver API for Java, C#, Python, Ruby, Perl, PHP, JavaScript, and other languages. Many of the language bindings are provided by the Selenium project. For some languages, there are even multiple language bindings, e.g. WebDriverJs by Selenium and WebdriverJS by webdriver.io.


Reference Links

12238 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
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: element and check that it is what I expect. This is my code: def test_chart_renders_from_url(self): url = 'http://localhost:8000/analyse/' …
Richard
  • 62,943
  • 126
  • 334
  • 542
125
votes
21 answers

Selenium WebDriver: Wait for complex page with JavaScript to load

I have a web application to test with Selenium. There is a lot of JavaScript running on page load. This JavaScript code is not so well written but I can't change anything. So waiting for an element to appear in the DOM with findElement() method is…
psadac
  • 2,312
  • 5
  • 32
  • 41
1
2 3
99 100