|
目的:在用户表中添加若干用户,如果是新用户直接添加成功,如果是已经存在的用户,需要对弹出的对话控点击确认,"cansel"这一次添加后继续添加.
录制的添加一个新用户的脚本:
JavaWindow("System User Management").JavaButton("add").Click
JavaWindow("System User Management").JavaDialog("Create New User").JavaTab("JTabbedPane").Select "General"
JavaWindow("System User Management").JavaDialog("Create New User").JavaEdit("Account").Set DataTable("p_Text", dtGlobalSheet)
JavaWindow("System User Management").JavaDialog("Create New User").JavaEdit("Account").PressKey "C",micCtrl
JavaWindow("System User Management").JavaDialog("Create New User").JavaEdit("Real Name").Set "123456"
JavaWindow("System User Management").JavaDialog("Create New User").JavaEdit("Cert Number").Set "123456"
JavaWindow("System User Management").JavaDialog("Create New User").JavaEdit("Phone").Set "123456"
JavaWindow("System User Management").JavaDialog("Create New User").JavaEdit("Address").Set "123456"
JavaWindow("System User Management").JavaDialog("Create New User").JavaEdit("Comments").SetCaretPos 0,0
JavaWindow("System User Management").JavaDialog("Create New User").JavaEdit("New Password").SetSecure "44442ece631adb03dffd54fd9d113ff499f2"
JavaWindow("System User Management").JavaDialog("Create New User").JavaEdit("Confirm Password").SetSecure "44442ed24b0a7d6eac859b00ebcc3d0a3172"
JavaWindow("System User Management").JavaDialog("Create New User").JavaTab("JTabbedPane").Select "Role"
JavaWindow("System User Management").JavaDialog("Create New User").JavaButton("addall_grey").Click
wait 2
JavaWindow("System User Management").JavaDialog("Create New User").JavaButton("commit").Click
录制的添加已经存在的脚本时在上面脚本的基础上需要执行的动作:
JavaWindow("System User Management").JavaDialog("Create New User").JavaDialog("Create New User Error").JavaButton("ok").Click
JavaWindow("System User Management").JavaDialog("Create New User").JavaDialog("Create New User Error").Close
JavaWindow("System User Management").JavaDialog("Create New User").JavaButton("cancel").Click
问题: 如何将后面这部分脚本用条件语句加入到前面脚本中?谢谢 |
|