Book a Demo

Author Topic: Script for Counting test cases  (Read 2867 times)

Bolli

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Script for Counting test cases
« on: May 19, 2011, 10:15:14 pm »
Hello,

i'm sure there is a way to script my needs but i can't get to it:

I want to collect all the testcases on a special package and write out the passed ones.

I know i need the test class ( for example 1 for unittest) AND the Status from the test files.

Could you give me some help how to call and count the testcases in the selected package?

Workflow:

Check if right package is selected <<allready ok>>
count all testcases with class = 1 <<also a problem>>
count all testcases with class = 1 and status = pass << should run when i got the part before>>
output of the counters <<allready ok>

Could you give me the right answers?

Thanks in Advance

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Script for Counting test cases
« Reply #1 on: May 23, 2011, 05:28:15 pm »
Bolli,

There are two ways of doing this:
1. Loop over all elements of the package and for each element loop over its tests, and count the number of tests with the correct status
2. Use Repository.SQLQuery to query the database directly.

1. is the clean but slow way, 2. is the fast but dirty way.

Geert