How to get the status of the execution result in accordance with the current node report?

For example, suppose a test calls two actions: A and B. A performs an “unsuccessful” step by calling "Reporter.ReportEvent micFail, ... ”, and B performs the “passed” step by calling "Reporter.ReportEvent micpass, ... "

Reporter.RunStatus returns micFail as soon as the unsuccessful step was performed in A. Thus, even in B, when the status of B is completely “green”, it is impossible to say that in the “B” branch, there is no “unsuccessful” step. Test run status reported by Reporter.RunStatus ", then micFail .

So how can I get the current status of a branch?

I think what I'm looking for is the color (i.e., the execution status) of the current or current parent of the Reporter node.

+6
source share
3 answers

I don’t think you can, since Run Status is a complete test, not an individual action. Alternatively, you can call the ExitAction method and save the output in a variable to check the launch status when called from the RunAction method.

+1
source

If you want to update the status of each action at runtime ...

"add" Err.clear "at the beginning of the action and

 if Err.Number<>0 Then 'update your action status to Failed' End if 

at the end of the action. This will happen if you do not manually clear the Err.number number

What does he do if a runtime error occurs, the Err.number number changes, and you can use it to get runtime errors at runtime. Hope this helps :)

+1
source

You can create different nodes for different actions. Each node will show the state of the basic steps (for example, if any of the steps under this node failed, then node failed)

Link to create nodes in the report: http://www.advancedqtp.com/report-hierarchical-events-in-qtp-log/

You can start a new node for each action and reset the node as soon as the action is complete.

+1
source

Source: https://habr.com/ru/post/953578/


All Articles