google搜索 站内搜索                 软件测试门户 | 软件测试培训 | 文章资料精选 | 软件测试论坛 | 测试解决方案 | 软件测试博客 | 测试招聘求职 
打印

[求助] action之间的参数传递问题

action之间的参数传递问题


目标:我想做得是把登陆时的用户名作为订机票时候的客户的名字.
下面是我的做法
1.录制一个login的过程
2.录制一个order定机票的过程
3.在login的action中选择insert->call to copy of action,选择order action
4.在login中选择step->action properties设置一个output参数,参数名为username
5.在order中选择step->action properties设置一个intput参数,参数名为username
login的code如下:
Dialog("Login").WinEdit("Agent Name:").Set "111111"
parameter("username")=dialog("Login").WinEdit("Agent Name:").GetROProperty("text")
msgbox (parameter("username"))
Dialog("Login").WinEdit("Password:").SetSecure "4607a5c5b912f3e39b5373d215f01558060c8535"
Dialog("Login").WinButton("OK").Click

order的code如下:
Window("Flight Reservation").WinObject("Date of Flight:").Type "070513"
Window("Flight Reservation").WinComboBox("Fly From:").Select "Denver"
Window("Flight Reservation").WinComboBox("Fly To:").Select "Los Angeles"
Window("Flight Reservation").WinButton("FLIGHT").Click
Window("Flight Reservation").Dialog("Flights Table").WinList("From").Select "2612   DEN   08:57 AM   LAX   09:55 AM   NW     $130.80"
Window("Flight Reservation").Dialog("Flights Table").WinButton("OK").Click
msgbox (parameter("username"))
Window("Flight Reservation").WinEdit("Name:").Set parameter("username")

Window("Flight Reservation").WinRadioButton("First").Set
Window("Flight Reservation").WinButton("Insert Order").Click
我该如何设置或code才能使order中获得login的输出参数植呢?

TOP

action之间的参数传递的问题,可以先看看我的blog里的文章,如还有问题,可以再问.

TOP

还是没有看明白怎么获得output参数的值的,麻烦给说明一下啊

TOP

看了你的blog后我尝试着把登陆的名字做为输出参数传出来,我现在login在设置输出参数customer
然后赋值Parameter("customer")=dialog("Login").WinEdit("Agent Name:").GetROProperty("text")
msgbox (parameter("customer"))
此时已经能取道值了,然后我在main中这样写的
Dim customer
RunAction "login", oneIteration,customer
msgbox customer
可还是取不道植啊

TOP

我明白拉.我修改main中的RunAction "login", oneIteration,customer为RunAction "login", oneIteration,,,customer就可以了
原来我还设置了两个两个input参数.

TOP

可是为什么我的回放在第一次执行完后,有会回到main中重新执行呢?然后在调用login的时候就没有响应了

TOP

这个也不一定需要主函数,只是当一个action中的参数要想传到另一个action,就必须通过参数传递.不然在另一个action中是取不到对应的参数的

TOP

使用RunAction还要执行一遍action,有没有不执行的呢?

TOP

 
当前时区 GMT+8, 现在时间是 2008-12-2 00:28Copyright(C)上海博为峰软件技术有限公司 2001-2007 电话:021-64471599-8017
当您在访问网站、论坛及博客过程中遇到问题时可发送email:webmaster@51testing.com或发送论坛短信至管理员风在吹