Posts: 23
Threads: 13
Joined: Sep 2009
Reputation:
0
10-27-2009, 02:48 PM
Hello Guru's
i am using QTP 10. I have done a test where i add items into a catalogue and check whether it is located within the catalogue once completed but when i run the test again it tries to add the same item again so it fails. Is there a way to add different numbers in a sequence for example: QA00001, QA00002, QA00003 and so on??
Thanks in advance for your help
Cheers
Andy
Posts: 1,003
Threads: 1
Joined: Jul 2009
Reputation:
5
10-27-2009, 02:57 PM
Andy -
I am not sure if i get what you actually need. It would be of help if you had the code pasted with your post.
However if you are looking for a case of sequentially data generation then maybe this peice of code would help,
Code:
For i = 1 to 10 ' Hoping you need 10 data
paramname = QA0000&i
Next
or
' you can use random numbers
For i = 1 to 10
randnum = RandomNumber(1, 100)
paramname = QA0000&randnum
Next
Again, since i am not very clear with your question this may seem very irrelevant. If yes, please post the code you have been trying.
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Posts: 23
Threads: 13
Joined: Sep 2009
Reputation:
0
10-27-2009, 03:08 PM
I'll try to explain another way. I can't put code on here because my company won't allow details of company on here.
I have 100 items that i need to test to make sure they have been added to a catalogue that i designed. The starting reference is QA00001 and obviously it will end QA0000100. If i run the test a 100 times it will work but if i try to re-run it again, it will not work because these items are already included in the catalogue. I can't have duplicate numbers for example QA00003 and QA00003.
I hope this helps
Andy
Posts: 1,003
Threads: 1
Joined: Jul 2009
Reputation:
5
10-28-2009, 12:44 PM
Andy,
did the random number help you ? Try with it until i get you a solution.
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.