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

一曲冷凌霜 提交于 2019-12-11 00:15:24

问题


Can I determine (programmatically) how my current business component scriptcode has been initiated?

It could be

  • standalone (using "Run" from UFT's toolbar while the component is open)
  • from a standalone test execution (using "Run" from UFT's toolbar while a test calling the component is open)
  • from a test lab execution (using "Run" or "Run all" button in the test set im ALM)?

Foggily related: Can I determine if current test execs from test lab or interactively from within QTP IDE?


回答1:


If the component is executed standalone, CreateObject ("QuickTest.Application").CurrentDocumentType returns "Business component".

If the component is executed from within a BPT (no matter if the BPT is executed interactively, or from within a test set) CurrentDocumentType returns "Test".

Combined with the setting brought to light in the related question (and answer), this answers the question. It's as simple as that.



来源:https://stackoverflow.com/questions/34068840/can-i-determine-whether-current-component-is-executed-from-alms-test-lab-or-in

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!