Questions tagged [selenium-webdriver]

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

Selenium WebDriver is the successor to Selenium RC. Selenium WebDriver accepts commands (sent in Selenese, or via a Client API) and sends them to a browser. This is implemented through a browser-specific browser driver, which sends commands to a browser, and retrieves results. Most browser drivers actually launch and access a browser application (such as Firefox or Internet Explorer); there is also an HtmlUnit browser driver, which simulates a browser using HtmlUnit.

Unlike in Selenium 1, where the Selenium server was necessary to run tests, Selenium WebDriver does not need a special server to execute tests. Instead, the WebDriver directly starts a browser instance and controls it. However, Selenium Grid can be used with WebDriver to execute tests on remote systems (see below). Where possible, WebDriver uses native operating system level functionality rather than browser-based JavaScript commands to drive the browser. This bypasses problems with subtle differences between native and JavaScript commands, including security restrictions.

In practice, this means that the Selenium 2.0 API has significantly fewer calls than does the Selenium 1.0 API. Where Selenium 1.0 attempted to provide a rich interface for many different browser operations, Selenium 2.0 aims to provide a basic set of building blocks from which developers can create their own Domain Specific Language. One such DSL already exists: the Watir project in the Ruby language has a rich history of good design. Watir-webdriver implements the Watir API as a wrapper for Selenium-Webdriver in Ruby. Watir-webdriver is created entirely automatically, based on the WebDriver specification and the HTML specification.

As of early 2012, Simon Stewart (inventor of WebDriver), who was then with Google and now with Facebook, and David Burns of Mozilla were negotiating with the W3C to make WebDriver an internet standard. In July 2012, the working draft was released. Selenium-Webdriver (Selenium 2.0) is fully implemented and supported in Python, Ruby, Java, and C#.

3165 questions
43
votes
8 answers

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 selenium contributes to this. I use selenium to…
MxLDevs
  • 531
  • 1
  • 4
  • 5
26
votes
8 answers

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:…
Pavan
  • 269
  • 1
  • 3
  • 3
7
votes
5 answers

Selenium WebDriver faster way to fill textboxes than Sendkeys()

So I have multiple TextBoxes I need to fill and Sendkeys() takes a lot of time, is there a faster way to fill TextBoxes in Selenium?
Adamus77
  • 103
  • 2
  • 2
  • 5
6
votes
2 answers

How do I resolve a "Lock file still present" error?

I've got a Perl-based Selenium instance running on my Win7 workstation. When I fire up a test script, I get an error "Lock file still present!" Caused by org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher$FileLockRemainedException:…
KatieK
  • 851
  • 1
  • 10
  • 10
6
votes
2 answers

Capturing http errors and customizing the message in webdriver

How to Capture HTTP errors on a web page such as page not found, 500 Internal server errors and customizing the message in webdriver.
Ravi
  • 61
  • 1
6
votes
3 answers

How to select an element whose id is dynamic and keeps changing

There is a type and search drodown which will appear after user type in the value. I need to click on the dropdown which contains the name of the drop down field. The problem here is that there is no unique attribute present (No unique class, no…
Som Ghosh
  • 197
  • 3
  • 7
  • 19
5
votes
1 answer

Selenium & Adwords - How am I getting logged out?

I am currently building a reporting tool with Selenium on Adwords. (And no, I cannot use Google's API because it doesn't provide the functionality I want). I am trying to avoid logging in and logging out because I understand frequent logins and…
Hot dog
  • 61
  • 2
5
votes
4 answers

How to wait until for "particular text" is present that to using insensitive/Ignore case?

wait.until(ExpectedConditions.textToBePresentInElement(By.xpath("path"), "Text")); The above command executes successfully only if the text in the locator is exactly same as "Text" but fails when the text in the locator is Case Insensitive . For…
Pradeep Dawaljee
  • 51
  • 1
  • 1
  • 2
5
votes
2 answers

Selenium webdriver for chrome too slow

I am working on a video consultation application where I need three separate windows to remain open simultaneously for a test case. I am using keyword driven framework using java with selenium and following code to open up new instances of chrome…
Annu
  • 51
  • 1
  • 1
  • 2
4
votes
1 answer

Does implicit wait set to 30secs will always wait 30secs even if it finds the element at 5 secs?

Does implicit wait set to 30secs will always wait 30secs even if it finds the element at 5 secs? Explicit wait for 30 secs will stop if it met the condition at 5 secs, but does implicit wait do the same? I also wonder in what cases do we have to use…
4
votes
3 answers

Unable to switch to frame which is inside an iframe

I am unable to locate a frame inside an iframe. I have attached the screenshot of the html page. I am able to locate iframe 'content' by xpath //div[@id='pageContentDiv']//iframe which I verified in chrome and my code is working. WebElement frame1…
kiran kumar
  • 49
  • 1
  • 1
  • 5
4
votes
3 answers

How to make Selenium Tests for touchscreens

I work on a very big project that has Unit tests, integration tests and selenium tests. We use the selenium tests to test a webapp frontend in Chrome, Firefox and Edge. But one of the frameworks we use has a controller that doesn't work correctly…
J_rite
  • 155
  • 1
  • 7
4
votes
2 answers

How to apply the "Small, Atomic, Autonomus" rule into complex project

I've been hired in a company, where I'm the only QA Engineer in the team. One of my goals is to automate UI tests by using Selenium Webdriver. The project, that I'm working on, is complex form and every steps are related to each other. I mean it is…
mathsicist
  • 95
  • 5
4
votes
6 answers

Is it possible to automate tests for in progress sprint

I have been asked to automate the tests while developer has finished only some part of the change in the current sprint. I have no framework, but I have been asked to concurrently automate the tests, so by the time coding part is done, automated…
Faiz
  • 809
  • 4
  • 18
  • 32
3
votes
1 answer

Can Selenium automate iOS Safari webpage tests on a real iPhone?

I want to automate a website on a real iPhone with Selenium. Is that possible or do I need Appium? Ideally I will launch my tests from my Windows machine via RemoteWebDriver edit: it looks like it might work in iOS…
patrick
  • 151
  • 6
1
2 3
17 18