I want to know what is the importance of test-driven development with Selenium/Webdriver?
Is it a framework ?
TDD always means the unit test to drive the development, not the function test or system test. and Selenium is a framework for the GUI test which is mainly applied in the function test.
so based on my experience, the Selenium is not a suitable framework for the TDD process.
from my opinion, Selenium is useful when the web is a mature web with stable functions. if the web is not mature and needs to be often changed,then it will cause big efforts in the maintenance of Selenium cases.
Test-Driven Development is a way of of developing software, its a practise. It is a process you can follow. You write a failing tests and implement just enough code to make the test pass, afterwards you clean or refactor your code and create a new failing test. Repeat this cycle until your software is done.
Mostly TDD is used with unit-tests and less with integration or functional tests.
Now writing Selenium tests first is not something that is done often, because you do not know yet how your web-page design will be. Although it can certainly be done. More often a BDD (Behaviour-Driven Development) cycle is used. In BDD the external or user behaviour is described and executed by the tests. Still it uses the same cycle, describe the behaviour first before you do the actual coding. (its the same as TDD, but more descriptive to communicate between users and developers)
The main thing here is just to write test-cases first before doing any coding, but one test at a time.
If TDD is important, thats too objective to answer, but I think its important to understand. It is a process and a handy tool for developers to solve certain software problems. Understand when and why it is practical. I would execute a couple of TTD coding kata's to get the grasp of it.
More information: