51Testing软件测试论坛

标题: 调用action,能否只用代码实现,望赐教! [打印本页]

作者: photo_liu    时间: 2006-10-9 17:05
标题: 调用action,能否只用代码实现,望赐教!
在action1中调用action2,
我想请问的是  在expert view中只用代码实现调用action (RunAction "调用模块名", allIterations)似乎不能够实现,
而是一定要在keyword view中insert call to existing action添加调用的action,
我是想通过一个主控的action,在外部sheet中表中将需要调用的action参数化,
但是有这样手动操作的话就不能实现全部的自动化,请问能够只用代码就能实现么?

谢谢各位

[ 本帖最后由 photo_liu 于 2006-10-9 17:14 编辑 ]
作者: xiaonan    时间: 2006-10-10 09:07
RunAction "new order", oneIteration

这样调用不可以吗?
作者: maguschen    时间: 2006-10-10 09:29
QTP关于RunAction的帮助。有一段注意的事项:

Note: Before you can use the RunAction statement in the Expert View for an external action, you must first call or copy the external action into your test by choosing Insert > Copy of Action or Call to Action. If the external action does not exist in your test, the RunAction statement is not recognized. For more information on copying or calling external actions, refer to the QuickTest User's Guide.


要在EV里面用 RunAction "Action[Test1]", oneIteration 这个语句,在此之前是需要调用外部的Action,就是:
Insert >  Call to Copy ofAction
Insert >  Call to Existing Action


如果不做上面的操作,RunAction没法识别哪个Action才是你想要调用的sdlkfj2
作者: photo_liu    时间: 2006-10-10 09:53
楼上的正解,
所以我想请教的是能不能不用外部调用而直接用其他语句调用action




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2