博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
QTP基本使用——associate actions
阅读量:4052 次
发布时间:2019-05-25

本文共 1309 字,大约阅读时间需要 4 分钟。

用实例来说话

E.g 现在有一个登陆框 , 点击button “Help”查询登陆密码, 确定后输入账号密码 , 然后登陆 系统,最后关闭

其一: Check the Help about this system.

1) Dialog("Login").WinButton("Help").Click // 点击Dialog “Login”上面的 WinButton "Help"

2) If  Dialog("Login").Dialog("Flight Reservations").Exist Then  //如果Dialog "Flight Reservations"存在, 则执行下面的操作
      Dialog("Login").Dialog("Flight Reservations").WinButton("确定").Click  //click the button "确定"
    End If

 

其二: put in the agent name and password, then close the window.

3) Dialog("Login").WinEdit("Agent Name:").Set "mercury"  //Agent name is set as "mercury"

4) Dialog("Login").WinEdit("Password:").SetSecure "4b892adbc75260f617acbe3e950f7551b440f709" //set the password which is encrypted.
5) Dialog("Login").WinButton("OK").Click //Click the button "OK"
6) Window("Flight Reservation").Close  //Close the window "Flight Reservation"

 

PS: 可以将其一分离成为通用的action, 那么在调用它的时候就需要进行关联

First : create new action(action_help)

Step 1: Insert -> Call to new action. Input action_help.

Step 2: Click with RSK and select Action properties. Then select "Reusable action".

 

Second : associate the action

Step 1: Save all the actions. Resources -> Object Repository -> File -> Export Local Objects.

Step 2: Set the association. Resources-> Associate Repositories -> Add repository.

 

Now set the  available actions and associated actions

 

 

转载地址:http://hecci.baihongyu.com/

你可能感兴趣的文章
关于无人驾驶的过去、现在以及未来,看这篇文章就够了!
查看>>
所谓的进步和提升,就是完成认知升级
查看>>
为什么读了很多书,却学不到什么东西?
查看>>
长文干货:如何轻松应对工作中最棘手的13种场景?
查看>>
如何用好碎片化时间,让思维更有效率?
查看>>
No.174 - LeetCode1305 - 合并两个搜索树
查看>>
No.175 - LeetCode1306
查看>>
No.176 - LeetCode1309
查看>>
No.182 - LeetCode1325 - C指针的魅力
查看>>
mysql:sql alter database修改数据库字符集
查看>>
mysql:sql truncate (清除表数据)
查看>>
yuv to rgb 转换失败呀。天呀。谁来帮帮我呀。
查看>>
yuv420 format
查看>>
yuv420 还原为RGB图像
查看>>
LED恒流驱动芯片
查看>>
驱动TFT要SDRAM做为显示缓存
查看>>
使用file查看可执行文件的平台性,x86 or arm ?
查看>>
qt5 everywhere 编译summary
查看>>
qt 创建异形窗体
查看>>
简单Linux C线程池
查看>>