I don't know it would be good idea. So I am looking for PROS and CONS of making Selenium Framework using Spring Framework. I have not come across a single forum/post/tutorial about this idea.

If its good idea, I am also looking for getting started doc

  • the pros and cons will come from a list of requirements of the project. Can you clarify what these are?
    – ECiurleo
    Commented Mar 18, 2016 at 10:45

3 Answers 3


The simple pattern of separation of concerns is vital to any testing framework. MVC is simply a form of separation for web pages. In a testing framework, you should have unit tests for the controller components and Selenium tests for the Page components. You should also have unit tests for any access functionality. How you choose to organize this depends more on the needs of the project and less on the fact that it uses MVC. Perhaps a better scenario is such:

  • Framework:

    • Setup
    • Teardown
    • Reporting (Local, DB, etc...)
  • Unit

    • Test Controller Methods
    • Test Access Methods
    • Any services the site interacts with
    • Anything else that is supposed to be very fast to test
  • Selenium

    • Test Page as an object
    • Test Components of page as an object
    • Anything else that is slow

You might study the paradigms of model based testing or data driven testing and how you might implement them to separate the concerns of the testing.


It helps to be specific when you talk about Spring because it encompasses a number of projects. It is well-known as an MVC framework, but it can make sense to use it even if you are not developing a web application. In particular, if you need to use libraries that depend on Spring, the easiest way to use them may be to use Spring, too.

That said, when something goes wrong with Spring, it can be notoriously hard to debug. If you are inexperienced with Java, you may be better off staying away from Spring.


It does not make sense. Spring is MVC framework for web applications. Browser automation using Selenium does not care about MVC pattern.

Most important pattern for browser automation would be Page Object. Google will give you many ideas, I mentioned many times in my answers too.

  • 3
    MVC is Model View Controller. View will be my test cases, Controller will be all initialization (WebDriver, PageFactory, setup, teardown etc), Model will be java file per page of website. I believe you have strong points to reason with your words "doesn't make sense" , Could you please elaborate your answer, in more words.
    – paul
    Commented Feb 16, 2016 at 3:57
  • In MVC, View just displays the data from model. Controller has the logic. If you feel that you can waterboard MVC pattern until it confesses to be a good fit for testing, go ahead, have fun. I think MVC is not a good fit, but go ahead and prove me wrong. Commented Feb 16, 2016 at 18:28
  • 1
    – paul
    Commented Feb 17, 2016 at 9:23

Not the answer you're looking for? Browse other questions tagged or ask your own question.