我能否确定当前组件是从 ALM 的测试实验室执行还是以交互方式执行?

Can I determine whether current component is executed from ALM's test lab, or interactively?

我能否确定(以编程方式)我当前的业务组件脚本代码是如何启动的?

可能是

模糊相关:Can I determine if current test execs from test lab or interactively from within QTP IDE?

如果组件独立执行,CreateObject ("QuickTest.Application").CurrentDocumentType returns "Business component".

如果组件是从 BPT 中执行的(无论 BPT 是交互式执行的,还是从测试集中执行的)CurrentDocumentType returns "Test".

结合相关问题(和答案)中揭示的设置,这回答了问题。就这么简单。