LoadAndRunAction方法的使用

上一篇 / 下一篇  2010-12-24 00:26:35 / 个人分类:QTP/UFT

脚本运行到该步骤时,调用其他脚本中的action并运行

?YP'p5b'r0

可以使用条件语句动态的调用不同的外部action51Testing软件测试网cts(w~ _6qlz

当运行该步骤时,才会加载该action,而不是当打开测试时,因此51Testing软件测试网9[ iD7Z&A/h0_

被调用的action不会在以下地方显示

6uU+[f |0

Qtpsettingresources51Testing软件测试网Pe9VF{'@O

Testflow

4~'z:v!ey qw@0

Missing Resources51Testing软件测试网ai!z)kEUmh

Qc的测试资源模块的附件选项卡(这个有点不解)51Testing软件测试网 F-t0w#x4m

  • 因为是在运行时才加载action,而不是像call to existing action那样会打开一个action。所以在运行过程中对性能会有所影响
  • During a run session, you can view the actions that are run using the LoadAndRunAction statement. As an action begins to run, the action name is displayed in theLoadAndRunActionCalls section of the Action toolbar in the Keyword View and in the Expert View. The called actions remain listed in the toolbar until the end of the run session, at which point they are cleared from the list.
  • At the end of a run session, all of the actions that were dynamically loaded are unloaded. In the Test Results window, you can view the steps that ran during the run session.

语法:51Testing软件测试网:t&d7F$r0i{

LoadAndRunAction(TestPath, ActionName, [Iteration], [Parameters])

oj~Ga[`B$}ek4]z0

TestPath相对路径/绝对路径/QC中的路径51Testing软件测试网 a?&d+Wl

ActionNameaction的名称51Testing软件测试网,a a A0l&d!S JnLKL8U

Iteration:循环的设置:oneIteration0(Default)

:oq$iD)xTe0

allIterations1

2zGKZ[&I0

"1-7"51Testing软件测试网^BSb|[B'h

Parameters:参数包括输出参数和输入参数

:K)LM.[+B9l0

 51Testing软件测试网 SD+{7M y*te

Example51Testing软件测试网.v,X4O;j$@XH_ n

1.使用绝对路径动态调用action

,Reri$^7@/g0

dim flag,testpath

8K"e7}5?-x9U4m0

TestPath="c:\QTPTest\"

2u"g8h N{F:t"C c0

if flag=true then

9e3]Fl'JZ&f v0

LoadAndRunActionTestPath&"OrderActions", "SilverOrder", oneiteration,51Testing软件测试网T/P)w h;E/m0W l(K(m G

else

!lR/MWS2}i}0

LoadAndRunAction TestPath&"OrderActions", "NormalOrder", oneiteration,51Testing软件测试网}7^!h6`{C

end if51Testing软件测试网8W Q(k_,z3h%w"rs

2.调用QC中的脚本的action

W3NZ0i&{5A!y0

If QCUtil.IsConnected  Then51Testing软件测试网-W#V6Sam1~5X2])Y

  LoadAndRunAction "[QualityCenter] Subject\testpath ","Action1",oneIteration,51Testing软件测试网n/mh8k7e9F

  End If

_7\"w!M4rvU0

 51Testing软件测试网;r0j2?k&w.I`

51Testing软件测试网 s d\`3D


TAG:

 

评分:0

我来说两句

Open Toolbar