Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why do we use WebDriver instead of Selenium IDE?

Why can't we just record all of our test cases in Selenium IDE, export it to Java/WebDriver and run it in WebDriver with Eclipse?

I need a clear explanation as I am very much confused in using WebDriver!

And can anyone please explain why IDE recorded scripts fail in WebDriver?

like image 529
Sagar Avatar asked Oct 30 '13 13:10

Sagar


People also ask

Why do we use WebDriver in Selenium?

Selenium WebDriver is a web framework that permits you to execute cross-browser tests. This tool is used for automating web-based application testing to verify that it performs expectedly. Selenium WebDriver allows you to choose a programming language to create test scripts.

Should Selenium use IDE?

Selenium IDE allows to edit, record and debug the tests. The main purpose to create Selenium IDE is to increase the speed of test case creation. It helps the users to take record quickly and play back tests in the actual environment that will run in. The interface supports multiple extensions and it is user-friendly.

What is the difference between Selenium IDE Selenium RC and WebDriver?

The major difference between RC and WebDriver is, RC uses a remote control to convert your tests into browser native code, your tests interact with the Remote control and the remote control interacts with the browser where as WebDriver directly interacts with the browser without any Remote server, so the execution is ...


1 Answers

why cant we just record all of our test cases in IDE, export it to java/webdriver and run it in webdriver

Great question, and here is the answer:

Selenium IDE is a Record and Playback tool, which is very easy to use, but it's very unreliable. Record and playback is typically a frowned upon in web applications. Since web applications are frequently changed, the IDE is not an ideal solution for a production environment, because of the maintenance nightmare that may arise.

Let me give you a practical example. You record your test, and you find an element with a dynamic ID. Sure we can import it into eclipse, but what happens when that test starts failing down the road? why not simply make your test agile and independent to catch these in the first place.

It also boils down to your principles of test automation. Test automation in MY opinion (and several other professionals), believe that test automation should be approached from a programming perspective. Programmers should write the tests, and maintain the tests. Ideally, your quality assurance personnel should be trained to write and maintain their own tests.

So again, back to your question, the IDE is designed to be a quick solution to automation, NOT a solution to a full regression suite.

And can anyone please explain why IDE recorded scripts fail in Webdriver?

I haven't used the IDE in a while, but the reason they fail, is because the scripts that are exported, are simply the steps, not an entire java file. This also is because Selenium IDE exportations are supposed to be agnostic when it comes to how to run your test. Say I'm a user of jUnit.. what if Selenium IDE exported it to TestNG all the time? That wouldn't be fair.. honestly i'd rather create my own tests than changing that one line every single time i create my test file.

You may read the full text of a research conducted, called Why do Record/Replay Tests of Web Applications Break?

like image 139
ddavison Avatar answered Oct 05 '22 14:10

ddavison