Hello Everyone,

Below is script where I am adding a new user, but if a user already
exist with the same ID then a Alter dispalys indicating that the ID
already exists. I want to do is allow the script run by adding a user
and if the ID exists then it needs to go back in and put in a
different ID I am trying to a loop. If you help me resolve this, i
would greatly appreciate it.


SwfWindow("DHA - You are currently").SwfButton("btnAdd").Click
dialog = True
NewUser "Jame lee"  '****Enter a new user ID***********
SwfWindow("DHA - You are currently").SwfWindow("Add User").SwfEdit
("txtPassword").SetSecure "xxxx"
SwfWindow("DHA - You are currently").SwfWindow("Add User").SwfEdit
("txtConfirmPassword").SetSecure "xxxxxx"
SwfWindow("DHA - You are currently").SwfWindow("Add User").SwfComboBox
("cboUserType").Select "James"
SwfWindow("DHA - You are currently").SwfWindow("Add User").SwfEdit
("txtLname").Set "Lee"
SwfWindow("DHA - You are currently").SwfWindow("Add User").SwfEdit
("txtFname").Set "Doctor"
SwfWindow("ePDHA - You are currently").SwfWindow("Add User").SwfEdit
("txtID").Set "12434"
SwfWindow("DHA - You are currently").SwfWindow("Add User").SwfButton
("btnAddUser").Click
SwfWindow("DHA - You are currently").SwfWindow("Add User").Dialog("DHA
- [Acknowledgement]").WinButton("OK").Click

Do
If dialog = SwfWindow("DHA - You are currently").SwfWindow("Add
User").Dialog("DHA - [Alert]").Exist Then
SwfWindow("DHA - You are currently").SwfWindow("Add User").Dialog("DHA
- [Alert]").Static("User with same ID already").Check CheckPoint("User
with same ID already exists in the database.")
SwfWindow("DHA - You are currently").SwfWindow("Add User").Dialog("DHA
- [Alert]").WinButton("OK").Click
End if
        Loop dialog
-- 
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en

Reply via email to