如何根据当前报告节点获取运行结果状态?

编程入门 行业动态 更新时间:2024-10-26 12:25:02
本文介绍了如何根据当前报告节点获取运行结果状态?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

例如,假设一个测试调用两个动作A和B. A通过调用"Reporter.ReportEvent micFail, ..."执行失败"步骤,而B通过调用"Reporter.ReportEvent micpass, ..."

For example, suppose a test calls two actions, A and B. A performs a "failed" step by calling "Reporter.ReportEvent micFail, ...", and B performs a "passed" step by calling "Reporter.ReportEvent micpass, ..."

Reporter.RunStatus在A中执行了失败的步骤后立即返回micFail.因此,即使在B中,B的状态完全为绿色",也无法在"B"中分辨出来分支,不存在失败"步骤.从此以后,由Reporter.RunStatus报告的测试运行状态为micFail.

Reporter.RunStatus returns micFail as soon as the failed step has been performed in A. So even in B, with B´s status being completely "green", there is no way to tell that in the "B" branch, there is no "failed" step present. The test run status reported by Reporter.RunStatus" is micFail from then on.

那我怎么能 获得当前分支"的运行状态?

So how can I get the current "branch"´s run status?

我认为我正在寻找的是当前或当前父级Reporter节点的颜色(即运行状态).

I think what I am looking for is the color (i.e. the run status) of the current, or current parent´s, Reporter node.

推荐答案

我不认为您可以,因为运行状态"用于完整测试,而不用于单个操作.另外,您可以调用ExitAction方法并将输出存储在变量中,以检查从RunAction方法调用时的Action Run Status.

I dont think you can since Run Status is for the complete test and not for individual action. Alternatively, you can call the ExitAction method and store the output in a variable to check the Action Run Status when called from RunAction method.

更多推荐

如何根据当前报告节点获取运行结果状态?

本文发布于:2023-11-25 15:50:36,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1630369.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:节点   状态   报告

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!