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
62
votes
15 answers

How to handle windows file upload using Selenium WebDriver?

I have seen lots of questions and solutions on File upload using Selenium WebDriver on Stack Overflow. But none of them are working for following scenario. Someone has given a solution as following // assuming driver is a healthy WebDriver…
Jasmine.Olivra
  • 1,751
  • 9
  • 24
  • 37
59
votes
1 answer

Getting the URL of the current page using Selenium WebDriver

I'm attempting to get the URL of the currently open page. I am using Selenium WebDriver and Java. I am accessing the current URL via: WebDriver driver = new WebDriver(); String url = driver.getCurrentUrl(); however, the URL does not appear to…
Karen
  • 885
  • 2
  • 7
  • 11
59
votes
6 answers

Equivalent of waitForVisible/waitForElementPresent in Selenium WebDriver tests using Java?

With "HTML" Selenium tests (created with Selenium IDE or manually), you can use some very handy commands like WaitForElementPresent or WaitForVisible. waitForElementPresent id=saveButton When…
Jonik
  • 80,077
  • 70
  • 264
  • 372
58
votes
10 answers

How to stop Selenium from creating temporary Firefox Profiles using Web Driver?

I am using Selenium Web Driver API with Java. Every time I want to debug my test cases, a temporary profile for Firefox is created in the temporary files directory. This is a headache in two ways. It definitely is taking unnecessary time to create…
Ranhiru Jude Cooray
  • 19,542
  • 20
  • 83
  • 128
58
votes
5 answers

Driver executable must be set by the webdriver.ie.driver system property

I am using Selenium for automating the tests. My application exclusively uses IE, it will not work on other Browsers. Code: import org.openqa.selenium.ie.InternetExplorerDriver; import org.openqa.selenium.By; import…
vkrams
  • 7,267
  • 17
  • 79
  • 129
56
votes
2 answers

Is it possible to download browser in iphone simulator

I run my selenium tests across different web browsers like google chrome, firefox ie ect. These tests are being conducted in windows and Mac machine. We have requirement to run those tests in mobile browsers. I was able to run in mobile simulator…
Sajit Gangadharan
  • 707
  • 1
  • 5
  • 16
55
votes
7 answers

Is there a Selenium WebDriver available for the Microsoft Edge browser?

As of the date of this post the name "Microsoft Edge" has just been officially announced as the default browser for the new Windows 10. It may be premature to ask but I would like to know if a new Selenium WebDriver is available for it and if not,…
55
votes
4 answers

Python selenium: wait until element is clickable - not working

I will test a web-app. there is a button available in my table to select all entries. I've tried: driver.wait.until(ExpectedCondition.element_to_be_clickable((By.XPATH, "myXpath"))).click() selenium clicks on the button, but nothing happens. (also…
Storm
  • 728
  • 2
  • 7
  • 17
55
votes
12 answers

How can I check if some text exist or not in the page using Selenium?

I'm using Selenium WebDriver, how can I check if some text exist or not in the page? Maybe someone recommend me useful resources where I can read about it. Thanks
khris
  • 4,809
  • 21
  • 64
  • 94
54
votes
3 answers

"Error while loading shared libraries: libnss3.so" while running Gtlab CI job to perform automated testing using webdriverio

I'm setting up the CI job for automated testing in selenium inside Gitlab CI, but the test is failing due to the issue. 019-09-27T11:03:17.404Z INFO @wdio/cli:Launcher: Run onPrepare…
shaurya
  • 581
  • 1
  • 4
  • 8
52
votes
14 answers

How to hide Firefox window (Selenium WebDriver)?

When I execute multiple test simultaneously, i don't want to keep Firefox browser window visible.. I can minimize it using selenium.minimizeWindow() but I don't want to do it. Is there any way to hide Firefox window? I am using FireFox WebDriver.
Paresh
  • 1,140
  • 2
  • 12
  • 29
52
votes
2 answers

How can I use command line arguments in Angularjs Protractor?

I'm using Protractor to perform some end to end tests, and I'd like to pass in login credentials through the command line instead of storing them in a spec file. I found one post where someone used process.argv.forEach, but how can I store those…
Brendan
  • 1,403
  • 4
  • 18
  • 37
51
votes
13 answers

Best way to take screenshots of tests in Selenium 2?

I need a way to take screenshots of my functional tests. Right now I'm using Selenium 2 with C# bindings. I pretty much want to take a screenshot at the end of the test to make sure the desired page is displayed. Are there any particular tools you…
James
  • 5,622
  • 9
  • 34
  • 42
48
votes
10 answers

ChromeDriver does not exist in Selenium WebDriver C# test script

I have come across a few people with the same issue that seemed to have solved the problem with System.addProperty("webdriver.chrome.driver", ".../chromedriver.exe"); before instantiating the driver. I have had little luck with this and am still…
Highstead
  • 2,291
  • 3
  • 26
  • 30
48
votes
8 answers

Selenium WebDriver: clicking on elements within an SVG using XPath

I have an SVG object with a few circle and rectangle elements. Using webdriver, I can click on the main svg object, but not any of the elements within it. The problem only seems to be with clicking (or any mouse interaction), as I can use…
jgode
  • 1,821
  • 2
  • 18
  • 14