脚本运行到该步骤时,调用其他脚本中的action并运行
?Y P'p5b'r0可以使用条件语句动态的调用不同的外部action51Testing软件测试网cts(w~_6qlz
当运行该步骤时,才会加载该action,而不是当打开测试时,因此51Testing软件测试网9[ iD7Z&A/h0_
被调用的action不会在以下地方显示
6uU+[f |0Qtp的setting的resources里51Testing软件测试网Pe9VF {'@O
Testflow里
4~'z:v!ey
qw@0Missing Resources里51Testing软件测试网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]z0TestPath相对路径/绝对路径/QC中的路径51Testing软件测试网 a?&d+Wl
ActionName:action的名称51Testing软件测试网,a
aA0l&d!S JnLKL8U
Iteration:循环的设置:oneIteration或0(Default)
:oq$iD)xTe0allIterations或1
2zGKZ[&I0"1-7"51Testing软件测试网^BSb|[B'h
Parameters:参数包括输出参数和输入参数
:K)LM.[+B9l0 51Testing软件测试网
SD+{7M y*te
Example:51Testing软件测试网.v,X4O;j$@XH_n
1.使用绝对路径动态调用action
,Reri$^7@/g0dim flag,testpath
8K"e7}5?-x9U4m0TestPath="c:\QTPTest\"
2u"g8hN{F:t"C
c0if flag=true then
9e3]Fl'JZ&fv0LoadAndRunActionTestPath&"OrderActions", "SilverOrder",
oneiteration,51Testing软件测试网T/P)w
h;E/m0W
l(K(m
G
else
!lR/MWS2}i}0LoadAndRunAction TestPath&"OrderActions", "NormalOrder", oneiteration,51Testing软件测试网}7^!h6`{C
end if51Testing软件测试网8W
Q(k_,z3h%w"rs
2.调用QC中的脚本的action
W3NZ0i&{5A!y0If 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`