Solved

selenium test scripts automatic invocation

Posted on 2013-12-19
2
455 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Non-recursive backtracking, using a stack 1 103
print map entry 34 55
Windows 10 and JDK 7 7u85 4 33
oracle 11g 23 50
I worked at a US software company that used offshore contractors for ten years and offshore employees for three years. We had a positive experience and you can too.   When I interviewed people for positions in the US, I would tell them that we wor…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

896 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

17 Experts available now in Live!

Get 1:1 Help Now