Solved

selenium test scripts automatic invocation

Posted on 2013-12-19
2
480 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 36

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Software development teams often use in-memory caches to improve performance. They want to speed up access to, or reduce load on, a backing store (database, file system, etc.) by keeping some or all of the data in memory.   You should implement a…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

707 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