• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

TDD for HTML

 
Sahil Reddy
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to employ TDD for static HTML pages ???

Precisely, how to write tests for HTML pages ???

Regards
Reddy
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34214
341
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Sahil Reddy
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
author & internet detective
Marshal
Posts: 34214
341
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic