?
Solved

selenium test scripts automatic invocation

Posted on 2013-12-19
2
Medium Priority
?
497 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 2000 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

Interactive Way of Training for the AWS CSA Exam

An interactive way of learning that will help you visualize core concepts so that you can be more effective when taking your AWS certification exam.  Built for students by a student to help them understand the concepts that they are being taught.

Question has a verified solution.

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

Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Learn by example how to specify CSS selectors for Selenium WebDriver test automation software.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Suggested Courses
Course of the Month11 days, 23 hours left to enroll

752 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