Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [selenium-webdriver]

Used for questions about using Selenium WebDriver, a browser automation framework frequently used to automate testing in a browser.

67
votes
5answers
141k views

What is the correct way to select an <option> using Selenium's Python WebDriver

I would like to select an <option> child of a <select> using the Python WebDriver. I have a reference to the option WebElement I wish to select and have tried select() and click() methods ...
58
votes
14answers
256k views

How to download a file using Selenium's WebDriver?

Basically I want to at least check that a download-able file exists / download link works and preferably get stuff like the file size too. Here's an example: link = self.browser....
55
votes
18answers
10k views

What are some tools for testing Mobile web apps?

I'm thinking along the lines of a Firebug for the iPhone/iPad/Android/BB that can truly give more insight on the markup/scripts. Even when testing on the simulator/device, it's hard to truly simulate ...
46
votes
12answers
2k views

Building “slow to break” regression tests

I need to build a lot of regression tests for our product at work and I plan on using Selenium. I am concerned about building tests that will become quickly outdated and broken based on the fast pace ...
41
votes
18answers
47k views

Compare screenshots of rendered web pages

In my team, we use Selenium for automation of functional testing. We also do a lot of manual regression testing to make sure the appearance of the rendered web pages is ok. I would like to develop a ...
40
votes
10answers
143k views

How can I work with file uploads during a Webdriver test?

This is a canonical question, intended to provide a comprehensive answer to many related questions During the course of a Webdriver test, I want to upload files. However, this opens a native file ...
38
votes
4answers
9k views

Are Selenium functional tests reliable enough to be worthwhile?

I'm finding that regardless of how solid my tests scripts are, I still have tests that fail (falsely), even though they worked just fine before. I'm not talking about if markup changes (although that ...
36
votes
6answers
28k views

How to avoid triggering google captcha while browsing in a selenium-driven browser?

Preface: my goal is not to solve captcha using automation tools, but to attempt to understand why a browser that is being launched by selenium is being identified as a bot in the first place, and how ...
28
votes
3answers
159k views

A way to match on text using CSS locators

So I use xpath locators and slowly converting to CSS. I haven't found a way to do an exact match based on text. For example converting //a[text()='Log Out']. I know you can do css=a:contains('Log ...
28
votes
9answers
11k views

Page Objects design issues

I have started using the Selenium 2 /Webdriver web automation framework a couple of weeks ago and I'm generally pleased, but I find myself unsure about how to best design my Page Objects. The ...
25
votes
13answers
94k views

How to fill CAPTCHA using Test automation?

How can I automate "Enter CAPTCHA" using Selenium WebDriver?
25
votes
7answers
11k views

Is adding IDs to everything standard practice when using Selenium?

My team is using Selenium WebDriver and the QA team is having the developers add IDs to almost everything. Is that normal or is Selenium flexible enough that tests can be written with the markup that ...
25
votes
11answers
57k views

How can I reduce the execution speed in webdriver so that I can view properly what is happening on browser?

I want to reduce the speed for execution of script so that I can view the execution properly on browser. I want do this in webdriver.
24
votes
16answers
37k views

Under what circumstances is Sikuli better for test automation than Selenium or Watir?

The Sikuli website says: Sikuli is a visual technology to automate and test graphical user interfaces (GUI) using images (screenshots). Under what circumstances is Sikuli a better technology for ...
23
votes
13answers
33k views

What is a good website to hack around using Selenium?

I want to learn Selenium, but I don't know what to code. Sure, I can throw Google some queries, I can fill out some forms, press buttons, find divs and links, etc. But I think this stuff is pretty ...
23
votes
6answers
134k views

How do I work with dropdowns in Selenium Webdriver?

This is a canonical question, intended to provide a comprehensive answer to many related questions. I understand the basics of working with Selenium Webdriver; I can navigate to pages, click buttons, ...
23
votes
10answers
52k views

Chrome driver 2.28: “Chrome is being controlled by automated test software” notification. Can it be removed?

I have just updated my project with the latest chrome driver (2.28). When I run the browser through the driver, a yellow notification pops under the URL bar, saying "Chrome is being controlled by ...
22
votes
7answers
94k views

Selenium: reuse existing browser session, instead of opening new windows?

This has been asked a million times on the web, but there's no clear cut answer. I tried "-browserSessionReuse" today without any luck; my tests keep spawning new browser windows. X:\QA\Automation\...
21
votes
6answers
10k views

What makes a good selenium locator?

When automating UI tests with Selenium, it is often not absolutely clear what method and what locator to use to locate an element. Some locators are less reliable, less readable than others. And, ...
21
votes
10answers
174k views

How do I close the browser window at the end of a Selenium test?

I have googled for the answer, but the .stop() so frequently mentioned doesn't work for me. The Chrome window the test was running in remains open. def test_getResults(self): sel = selenium('...
21
votes
7answers
349k views

How to find element using contains in xpath

can anyone please help me how to use contains in my xpath? My xpath changes all the time when users are added, so I can't find element using xpath. This is my xpath: .//*[@id='contentText']/table/...
19
votes
4answers
53k views

How to Implement Page Object and Page Factory Pattern in Selenium Webdriver?

I am a beginner in learning selenium Webdriver. I am not able to understand how page object and factory models works and how it can be beneficial? Kindly help me explain it with detailed ...
18
votes
6answers
97k views

Running WebDriver without opening actual browser window

I've heard rumors that Selenium WebDriver can run without opening a real browser window, meaning it runs in the background. I am using the C# Client Drivers, FirefoxDriver within the automated tests, ...
18
votes
5answers
9k views

How does one get started with web test automation using Selenium?

So I've been testing web based analytical software now for the past 4 years or so with mostly manual techniques. But for 2015, I've set myself the goal of getting setup and start writing automated ...
18
votes
7answers
15k views

How to disable Chrome save your password? (Selenium Java)

What is the method to disable this pop-up: Do you want Google Chrome to save your password for this site? How to do this with Selenium Webdriver (Java)?
18
votes
5answers
24k views

Is there a captureNetworkTraffic implementation in Selenium 2 via webdriver?

If yes, how is it called, or where can I find more info about it? (I'm not talking about using WebDriverBackend.) If not, what alternatives are there?
18
votes
5answers
104k views

Webdriver Check if Checkbox is Set and Set it if Not

I am learning Webdriver with JUnit by going through Alan Richardson's Selenium Simplified book and taking translating the exercises/tests from Selenium RC to Webdriver. So far, this has proven to be ...
17
votes
8answers
3k views

Asking UI developers to adjust markup to improve automated tests

From time to time when doing test automation, a locator for the desired element is either too complicated, fragile or not readable. In cases like this, we ask developers to add IDs or other data-...
17
votes
11answers
28k views

Load Testing, Selenium Vs Jmeter Vs other tools

I have been using Selenium/Webdriver for functional testing in a grid setup. We are in the process of transitioning to a Solr based search service. I already have Solrmeter for load testing the ...
17
votes
7answers
4k views

How do I keep Selenium test cases DRY?

I'm somewhat new to Selenium and I have a problem. Whenever I write a test case, that test case starts with logging in, and it's the same four steps every time. If I change the password for that ...
16
votes
4answers
135k views

Selenium: How to identify the button WebElement

In my web page I'm having following two buttons: <button onclick="addToSelected('newApplicationForm');">Add Strategy</button> <button onclick="submitAddNewApplication('...
16
votes
3answers
106k views

Selenium: How to click at x,y coordinates?

I want to click at x, y coordinates like 52, 216-52, 295. How can this be done using Selenium? (I am using Mac OSX 10.8.5 with Selenium 2.40.0 and Firefox version 29.0)