Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
adding items issue
#1
Not Solved
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
Reply
#2
Not Solved
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.
Reply
#3
Not Solved
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
Reply
#4
Not Solved
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.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Pages and Frames adding _1, _2, _3... zunebuggy 1 1,499 05-30-2017, 12:17 AM
Last Post: Vichu M J
  [UFT] [WPF] DataGrid: get items of ControlTemplate robertosalemi 0 3,287 07-14-2016, 07:52 PM
Last Post: robertosalemi
  Adding negative amount in webedit Rose 1 1,999 06-30-2016, 09:34 PM
Last Post: babu123
  SwfList: unchecked all items robertosalemi 0 1,842 12-21-2015, 03:46 PM
Last Post: robertosalemi
  Select Menu items shilpaS 1 6,737 06-19-2015, 01:23 AM
Last Post: supputuri

Forum Jump:


Users browsing this thread: 1 Guest(s)