Making input data unique - 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 Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners) +--- Thread: Making input data unique (/Thread-Making-input-data-unique) |
Making input data unique - Brian - 09-10-2008 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 RE: Making input data unique - kishoreinchennai - 09-11-2008 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 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 RE: Making input data unique - swarnavure - 09-16-2008 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... RE: Making input data unique - kishoreinchennai - 09-17-2008 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 RE: Making input data unique - swarnavure - 10-03-2008 [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. RE: Making input data unique - tapandalal - 10-22-2008 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 |