Solved

selenium test scripts automatic invocation

Posted on 2013-12-19
2
452 Views
Last Modified: 2014-01-09
Hi,

I have about 10 selenium regression test scripts. i want to execute all those test scripts when I do a deployment to say QA environment. I want to make sure all scenarios are working. I am using java,j2ee, jsf, maven techonlogies for my j2ee webapplication. How do I make sure to auto invoke those selenium scripts whenever the build and deployment of the application happens.

please advise
Any links resources ideas highly appreciated. Thanks in advance
0
Comment
Question by:gudii9
2 Comments
 
LVL 35

Accepted Solution

by:
mccarl earned 500 total points
ID: 39730786
We've almost covered all of this in one of your previous questions. The only missing link is that you could/should use JUnit to run these selenium tests. Since these tests would probably be called "integration tests" (rather than unit tests) my suggestion would be to put these in a separate maven project, have that project "depend on" your main project and put you Test classes in this new project. That way when you build your main project (which happens very often) you don't necessarily run your integration tests, but you can easily run them by running "mvn test" in your "integration tests" project. Then you can setup your deployment to make sure that the "integration tests" project is run before the actual deployment happens. Exactly how this happens will depend on exactly how you "deploy" your app.

And so these test classes that you put in your new project are built using JUnit so they look very similar to any unit tests that you already have, it's just their purpose is quite different. Instead of just doing what is necessary to setup maybe one class that is the target of your unit test, in your integration test classes you need to setup your entire environment (which could entail starting a test web app container, a test database, inserting test data into that database, etc, etc).


As you may be able to see from the above, it's not a small job. And so I can't really give any step by step instructions, because so much depends on your particular environment and application and also I would still typing away on Christmas morning! ;) Have a read of this article to get you started...

http://docs.codehaus.org/display/MAVENUSER/Maven+and+Integration+Testing
0
 
LVL 7

Author Comment

by:gudii9
ID: 39738549
my suggestion would be to put these in a separate maven project, have that project "depend on" your main project and put you Test classes in this new project. That way when you build your main project (which happens very often) you don't necessarily run your integration tests, but you can easily run them by running "mvn test" in your "integration tests" project. Then you can setup your deployment to make sure that the "integration tests" project is run before the actual deployment happens.
can you point me to some example on how to do above.


Instead of just doing what is necessary to setup maybe one class that is the target of your unit test, in your integration test classes you need to setup your entire environment

can you please elaborate on this
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

One of the most important skills a software quality assurance engineer can possess is the ability to write clear and concise test case descriptions. Regardless of whether the test case is to be executed programmatically or manually, a well written d…
Introduction I've been in the software industry for over 20 years. I've interviewed at lots of companies, from start ups in stealth mode to some of the biggest and most successful. I've also conducted lots of interviews, especially as I've become a…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now