File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

best practise in testing?

 
david santana
Greenhorn
Posts: 10
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I'm a total beginner in testing so I don't know much about the best practice in this field..

when testing a website, should I make a test suite that contains test cases like this:

or should I just run the test cases one by one and change the baseUrl for each page?

if I should use the test suite, is it possible to put the @Before in the test suite instead of inside each test case? so that I only need to change the baseUrl once in a test suite...

thanks for being patient in dealing with my newbieness...
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 33716
316
Eclipse IDE Java VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes,
1) A suite is often better because you can easily run all tests. In an IDE, you can do this by selecting the package. A suite lets you do the same in Ant though. Take a look at Classpath Suite so you can use wildcards rather than listing out each class one by one.

2) Not built in, but you can write a small amount of code to do so. Here's an example of setup before a suite and tear down after a suite. The only disadvantage is that you are running as a main method rather than via a junit runner. No green bar. (Built in you can run code before and after a class, but not a suite.)
 
david santana
Greenhorn
Posts: 10
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm testing 3 websites. each one consists of many pages. in this test:
1. should I test the trivial things (header, sidebar link) in every pages or just once in the main page?
2. I'm using eclipse, so should I use a separate package for each page and separate projects for each websites?
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 33716
316
Eclipse IDE Java VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's no right answer to those. For #1, I would test it once because it is likely shared code. For #2, many organizational styles make sense. What you propose certainly does.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic