| Author |
TDD for HTML
|
Sahil Reddy
Ranch Hand
Joined: Jan 24, 2011
Posts: 143
|
|
How to employ TDD for static HTML pages ???
Precisely, how to write tests for HTML pages ???
Regards
Reddy
|
 |
Jeanne Boyarsky
internet detective
Marshal
Joined: May 26, 2003
Posts: 26192
|
|
I've never done TDD for a static page. If I was, I would use a tool like Selenium though:
I expect to see a field with the label "first"
write it
I expect to see a field with the label "last"
write it
I expect to see a submit button
write it
You said static though so I guess this would be more headers? For a single static page, the question feels like how would you TDD a word document? You could if you had requirements, but would it be necessary.
|
[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
|
 |
Sahil Reddy
Ranch Hand
Joined: Jan 24, 2011
Posts: 143
|
|
By TDD... I just wanted to mean that i want to have safety-net so that , i may ensure everything is fine.........
Essentially, i just want to have tests may be that could be written afterwards...
For Instance
1. All pages are present
2. Required elements are present as expected
Are these things possible with Selenium ???
Regards
Reddy
|
 |
Jeanne Boyarsky
internet detective
Marshal
Joined: May 26, 2003
Posts: 26192
|
|
|
Yes. Selenium let's you check the presence of elements. As does jwebunit. For static pages, jwebunit might be better because you don't have to worry about page interactions.
|
 |
 |
|
|
subject: TDD for HTML
|
|
|