Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Making input data unique
#1
Not Solved
Hey guys,

Ive currently automated a siebel application. Everything is working ok, except for one issue. The system takes in data and stores that data. The problem occurs because the developers have created a "no duplicates" policy (cant create duplicate data in the system)....therefore my excel sheet that im reading my input data from needs to be updated everytime i run the scripts (to keep the input data unique each time)

To make the data unique each run ive looked at putting a timestamp appended to the end of each input variable, ie read in the value "brian" from the excel sheet, but append "17.45 100908" to the end of it making it "brian 17.45 100908". This solution i have implemented but i was hoping for a better solution.

Does anyone know if it would be possible to call a sequence file or something where i could call the value in the sequence file once everytime i ran the script...without that number resetting when the script stopped. ie first time i run the script, call the sequence file which returns number "1", so i append this number to all data that gets read into my script. the next day i want to run the script again and when i call the sequence file it returns a "2" which i then append to all the data being read into my script. this solution would be alot cleaner and better.

Any help on this matter would greatly be appreciated

Regards,
Brian
Reply
#2
Not Solved
Why Not use Randomize and RND function which will give you a unique Number every time you call.

i used this in my code:

Code:
Randomize
Environment.Value("Client_No_Random")=Int((9999999 - 1111111 + 1) * Rnd) + 1111111

it throws me a unique client number everytime i run the test....

Interestingly RND Works exactly the way you have described in your 3rd paragraph

Regards
Kishore
Reply
#3
Not Solved
Even i do have the same problem, but ur solutions solves for numbers only i have fields like emailaddress, userid(inclusive of alphabets and numbers) should be inserted along with the empid in my application. so, how could i do in this case? plz help me out...
Reply
#4
Not Solved
There are many Simple Solutions

1)this will generate a unique number appened this number with all your fields which will make it unique

2)another simple idea would be keep a flat file for example txt file with the content "1"
you read this file and appened 1 with all your data once you read add 1 to this value and rewrite the file using VBFSO

3)or just create a excel sheet with unique values in a single column.

Every time your read the first cell after reading delete the value and save the file
that way when you read again you will have a unique value...
Hope this helps
Reply
#5
Not Solved
[quote=kishoreinchennai]
Hi Kishore,
Can u help me out by giving descriptive code for the solution 1 and 2 u have mentioned in ur reply.

Thanks in advance
swarna.
Reply
#6
Not Solved
Hi That's right, just want to make sure that if we want to use RND function we have to use Randomize statement before that, and in your example dod we need to give any value to RND number, e.g RND (Number).

just curious to know.. because I am going to use the same function in my script for Siebel app.

Thanks
Tapan Dalal
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Need to input Japanese Character through UFT Alaguraja 0 891 07-01-2020, 11:32 AM
Last Post: Alaguraja
  How to get input from the user in QTP? shanthiK 10 18,519 08-07-2017, 11:34 PM
Last Post: zunebuggy
  Web Object Unique ID Number zunebuggy 0 1,541 07-10-2017, 05:37 PM
Last Post: zunebuggy
Rolleyes QTP Unique Identification of object minug 11 12,866 02-26-2014, 12:39 PM
Last Post: supputuri
  Problem in Input from keyboard:sendkeys Rachna 1 4,962 10-14-2013, 06:07 PM
Last Post: anil2u

Forum Jump:


Users browsing this thread: 1 Guest(s)