Spring-MVC : Testing code by automatically running it in UI

I am working on a Spring-MVC application(config XML based, no Main class) in which I would like to do testing. I have known that there is a way to test code which is backend+frontend code. For that, I thought there would be some way I can check by running the code automatically in browser, which fills up forms, logs me in, etc.

And while that happens, I would be able to see in console as well as in the browser as to what is happening..

I have seen this in one of the company, but don’t know how they were doing it. Any ideas? Is it suitable for Spring-MVC?

The most common way of automating web testing through the front end is via a system called Selenium. It is server-architecture neutral, so it can be used with Spring or any other framework.

I would also highly recommend running integration tests without the ui, by using code that directly calls your controller methods, isolated from the server framework. Such tests are easier to write (once you get the hang of them) and less likely to break due to interface changes than ui-level tests.


I learned Selenium in a few days. It’s free. It’s really easy to get started with ‘Selenium IDE’, A user-friendly front-end with a screen recording function and great documentation. Once you get a feel for the IDE you can export your tests and run them through JUnit or TestNG using the ‘Selenium Webdriver’.


Trả lời

Email của bạn sẽ không được hiển thị công khai. Các trường bắt buộc được đánh dấu *