Can't Identify on Second loop - Printable Version +- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums) +-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP) +--- Forum: UFT / QTP Others (https://www.learnqtp.com/forums/Forum-UFT-QTP-Others) +--- Thread: Can't Identify on Second loop (/Thread-Can-t-Identify-on-Second-loop) |
Can't Identify on Second loop - MichaelS - 10-04-2011 He, I writing an qtp script to add users based on a input excel file. The script checks is the user exists and/or if the users contact info exist. If either exists, it writes an exception messages. If the user and contact info does not exist it should add the user and contact info. The problem I have is that it works when adding the first user, but does not when adding a subsequent user. I get the following error message: Can't identify the object "prfid" (of class weblist). Verify the object matches properties of an object currently displayed in your application. line 113 "sItemsInUserList=Browser("Browser").Page("Page").WebList("prfid").getroproperty("all items")" Here is the code. Did add a user change something? The repository should have been recorded many months ago and the first add should have an issue as well, but to new to QTP. Any ideas on how to resolve? Code: 'Let check if User exists RE: Can't Identify on Second loop - anil2u - 10-05-2011 Hi Michael, From what I could get from the info. provided is The Page may not be loading as quick as the script runs. Ensure that when the second run happens the Browser("Browser").Page("Page").Object exists. If it is, try using a Sync property to wait for the page and then proceed. Hope this helps RE: Can't Identify on Second loop - MichaelS - 10-07-2011 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 |