Forum Discussion

gdave's avatar
gdave
Regular Contributor
8 years ago

Batch Job Testing

Hi all

I am relatively new to TestComplete. I'll be primarily relying on record and play option as I am not very familiar with the coding side of things but any suggestions are welcome.
A quick overview on what my application under test do :
My application under test has to run a specific batch job. Once the job is kicked off it then moves to 'Jobs' tab which displays the batch job name/id and its state (eg: 'running', 'could not start' or 'failed'). Once the job is finished running it moves to 'Finished Jobs' tab where the job state is updated to 'Finished'.

Stuff I want TC to do :
I wish to design a test where once the batch job is started
Condition 1 - It finds the specific job with its job id in 'jobs' tab and checks for its state (eg: 'running', 'could not start' or 'failed').
Condition 2 - If the job state is anything else other than 'running' the test fails
Condition 3 - If the job state is 'running' it waits for while and again looks at that job id and its state
Condition 4 - Condition 3 is a loop unless TC could not find the job id in 'Jobs' tab' so at this stage it will then go to 'Finished Jobs' tab to check for the Job Id. If found, then the test will be Passed. Attached screenshot may help to understand this better.

I think the above can be achieved through coding easily but I am not too familiar with codes therefore I was wondering if someone can help me to design this with record and play. However if some can contribute with the sample code to design the above that too will be highly appreciated. Thanks

1 Reply

  • Marsha_R's avatar
    Marsha_R
    Champion Level 3

    Hi gdave

     

    I suggest a couple of things:

     

    • Get signed up for this month's free training mentioned at this link.  It's a monthly webinar and that will help you get started with TestComplete.  https://support.smartbear.com/training/
    • For designing your test, first you need to figure out exactly what you would do if you were testing it manually.  You'll be using TestComplete to execute the same steps that you would be if you were controlling the mouse/keyboard, so it's important to have those steps clear before you start.

     

    It's difficult for anyone to give you sample code of a general thing like "run a batch job".  We all have different environments under test and it's rare that any of us have exactly the same thing to test.  That being said, once you get started and are trying some things, if you get stuck, we can probably get you unstuck!

     

    Welcome!

    Marsha