Highlighted
Absent Member.
Absent Member.
1494 views

How to sync UFT with mainframe job execution

Hi ,

 

I am working on a script to automate mainframe test senario,

The senario contains several steps

after few initial step , it need to execute a mainframe job and then move to next screen to verify result and exit mainframe.

My am struggling in making uft wait till the job execution complete (as the job execution does not take definite time every time the job execution time varies ) so I cant use wait statement with specific time to hold UFT and UFT should execute the next step in the script only when the job exection completes.

thanks for your help

Thanks

Mangesh 

 

 

0 Likes
2 Replies
Highlighted
New Member.

If some job is being executed, then the mainframe exe should consume the CPU cycles. You can check for CPU usage and wait until the app not consumes any CPU.

SystemMonitor.GetValue("exe name","% Processor Time")

Inbuilt option from UFT you can try to know the CPU usage. If >0, it's busy doing something.

Also you can access the same using WMI. Refer this blog I got it from google.

http://dimyo.blogspot.com/2013/03/qtp-to-find-cpu-and-memory-usage-by-qtp.html

Accept as solution/Give Kudos to the author if the piece of information answered/helped you to solve your problem.
All the thoughts here are mine not related to my employer nor anyone.
Test Automation Ecstasy
0 Likes
Highlighted
Honored Contributor.. Honored Contributor..
Honored Contributor..

The mainframe job should (and must) have an upper limit to be executed, right?

Why not implement a loop in your automation where you every fifth minute checks whether the job has been completed or not. This do of course assume that the mainframe job triggers a specific status that you can verify on in your second page.

Your loop will then only:

  1. Pass if the mainframe job is completed and the correct status is appropriate
  2. Fail if the mainframe job has not been completed yet (or failed) and your upper limit has been exceeded.

Good luck!

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.