Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can't Identify on Second loop
#3
Not Solved
Thanks anil2u

I added a waitproperty, but that did not work. It still fails when it tries to check the users on the second iteration. See the code below. The sItemsInLIstBox contain the old value and not the new value. The pop up box with a list of users does appear well before qtp displays the error. The list not contains 1 additional users since we added one in the first iteration. It works when I close and open the bowser on each iteration. Any other suggestion or a better way to do this?

The flow is
first iteration
checkuser - populates sItemInListBox with users 12775 users
checkcontact A - populates sItemInListBox with contains 13591 users
If user and contact do not exist
add user
add contact
seond iteration
checkuser - Fails on the sItemInListBox with users 12775 users

Code:
'Let check if  User exists
Browser("Certificate Error: Navigation_2").Page("Page_9").Link("Profile Classes").Click
Browser("Certificate Error: Navigation_2").Page("Page_3").WebList("classes").Select "User"
Browser("Certificate Error: Navigation_2").Page("Page_3").Image("P_01-over").FireEvent "onmouseover"
Browser("Certificate Error: Navigation").Page("Page_3").Image("P_01-over").Click
Browser("Browser").Page("Page_9").WebList("prfid").WaitProperty "name", "prfid", 10000
sItemInListBox=Browser("Browser").Page("Page").WebList("prfid").getroproperty("all items")
If instr(1,sItemInListBox,sUser) > 0 Then
    bQTPUserExists=True
Else
    bQTPUserExists=False
End If
Browser("Schema Editing").Page("Page").WebButton("Cancel").Click
'Lets check if the user DexContact exists
Browser("Certificate Error: Navigation").Page("Page_2").Link("Profile Classes").Click
Browser("Certificate Error: Navigation").Page("Page_3").WebList("classes").Select "DexContact"
Browser("Certificate Error: Navigation").Page("Page_3").Image("P_01-over").FireEvent "onmouseover"
Browser("Certificate Error: Navigation").Page("Page_3").Image("P_01-over").Click
Browser("Browser").Page("Page_9").WebList("prfid").WaitProperty "name", "prfid", 10000
sItemInListBox=Browser("Browser").Page("Page").WebList("prfid").getroproperty("all items")
If instr(1,sItemInListBox,sDexContact) > 0 Then
    bQTPDexContactExists=True
Else
    bQTPDexContactExists=False
End If

Browser("Schema Editing").Page("Page").WebButton("Cancel").Click
Reply


Messages In This Thread
Can't Identify on Second loop - by MichaelS - 10-04-2011, 06:09 AM
RE: Can't Identify on Second loop - by anil2u - 10-05-2011, 06:05 PM
RE: Can't Identify on Second loop - by MichaelS - 10-07-2011, 07:07 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to end script in QTP if the Do Until loop goes to infinite. uma87 3 9,604 09-30-2011, 02:38 PM
Last Post: rajpes

Forum Jump:


Users browsing this thread: 1 Guest(s)