Best model/design technique for test scripts
carriann last edited by
What's the best/most advanced classes design/modelling approach when writing selenium webdriver scripts using Java. Example of one modelling approach is TDD and page object. Can we integrate both? Currently, I'm learning TDD using junit, but I'm not sure if i would be able to use it when writing selenium webdriver scripts.
Thanks in advance!
What's the purpose of the most advanced/the best/...? You should be more concerned about how well you test, not that much about the best/the most advanced etc. Sure, there are good and bad approaches, but I'd be careful about saying something is the best/the most advanced. How do you even recognise the best design? What are the metrics for that?
TDD stands for Test Driven Development, that roughly means you write tests first and then you develop a feature. So you should not end up with any new code that hasn't passed the tests. TDD refers to how you organise your work.
Design patters such as page object model is a general solution to some kind of problem you face in your code. In terms of the page object model, you basically create an interface that allows you, in your tests, to work with a page/part of the page/some element etc. The purpose of this pattern is not to duplicate code (well, I guess more design patterns exist because of this very reason). The bottom line is, it's how you organise your code.
Can we integrate both?
Having said all that about TDD and design patterns, I don't see a reason why you can't work in TDD style and use design patterns in your code.