- nnk.mca
- Posts : 3
Join date : 2009-09-08
Selenium with JUnit
Tue Dec 22, 2009 3:40 pm
Hi,
I am using selenium RC with JUnit Framework. So i want to know the advantages of using the JUnit with selenium RC?
Thanks in advance..
I am using selenium RC with JUnit Framework. So i want to know the advantages of using the JUnit with selenium RC?
Thanks in advance..
Re: Selenium with JUnit
Tue Dec 22, 2009 6:29 pm
hi,
Junit is basically use for white box testing. But if you are using selenium rc with Junit, you are able to get feature of junit to test your application functionally. your code with be robust and specific to scenarios rather than full application.
Advantages:
* You don't need to implement inner classes which are very awful
and bloat your test codes. Instead you can use closures. Using closures
for writing your mock objects can make your test codes smaller and more
compact!
* File operations are very easy to implement thanks to
AntBuilder. How many times do you need to make some file operations
(delete, mkdir, ...) within your test codes? Doing this with java.io is
not fun at all. Using AntBuilder for this purpose is a good thing,
since Ant is predestinated to do this job.
* If you are using SpringFramework you can easily create the
config files (application context) by using BeanBuilder. By using this
concept you don't need to put separate XML files in your test project.
Everything is integrated and centralized in your test class!
Disadvantages:
* No source code formatter for Groovy: This is a real disadvantage
for Groovy at the moment. If you are working in a team this could be a
nightmare: reading the code with different formatting, CVS compare is
difficult, ... are some examples to mention...
* The Groovy plug-ins (code completion, syntax coloring, ...) - at least for Eclipse - is still very buggy.
* You need to learn some new concepts like: closures - which is
also an advantage after you understand them! Without closures you
cannot implement inner classes in Groovy, which are mostly a must in
writing unit tests.
Hope this will help you.
Bye
Junit is basically use for white box testing. But if you are using selenium rc with Junit, you are able to get feature of junit to test your application functionally. your code with be robust and specific to scenarios rather than full application.
Advantages:
* You don't need to implement inner classes which are very awful
and bloat your test codes. Instead you can use closures. Using closures
for writing your mock objects can make your test codes smaller and more
compact!
* File operations are very easy to implement thanks to
AntBuilder. How many times do you need to make some file operations
(delete, mkdir, ...) within your test codes? Doing this with java.io is
not fun at all. Using AntBuilder for this purpose is a good thing,
since Ant is predestinated to do this job.
* If you are using SpringFramework you can easily create the
config files (application context) by using BeanBuilder. By using this
concept you don't need to put separate XML files in your test project.
Everything is integrated and centralized in your test class!
Disadvantages:
* No source code formatter for Groovy: This is a real disadvantage
for Groovy at the moment. If you are working in a team this could be a
nightmare: reading the code with different formatting, CVS compare is
difficult, ... are some examples to mention...
* The Groovy plug-ins (code completion, syntax coloring, ...) - at least for Eclipse - is still very buggy.
* You need to learn some new concepts like: closures - which is
also an advantage after you understand them! Without closures you
cannot implement inner classes in Groovy, which are mostly a must in
writing unit tests.
Hope this will help you.
Bye
- [Help] Problem of running selenium Testcase[Java Junit] with Selenium RC
- Is it possible running selenium testcase(junit) in selenium 2
- Is it necessary to use JUnit or TestNG with eclipse while using with Selenium RC?
- java.lang.NoClassDefFoundError-Selenium RC with Junit and EClipse IDE
- How to run same Selenium JUnit class several times in Eclipse
Permissions in this forum:
You cannot reply to topics in this forum