Micro Focus QTP (UFT) Forums
Dynamically Changing the Testdata by using macros - 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: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: Dynamically Changing the Testdata by using macros (/Thread-Dynamically-Changing-the-Testdata-by-using-macros)



Dynamically Changing the Testdata by using macros - nelmanoj - 03-23-2011

Hi,
After executing the scripts by using the QTP, dynamically it should change the testdata.testdata stored in one Excelsheet.
for example we have the data in centralised excel sheet
ex:ORG FOR HP15
after Execution the testdata should be changed to ORG For HP16 Is it possible to do this by using macros in excel.
and
is it possible to change the Object repository logical name and Physical description of the objects after one iteration of execution with out any manual intervention.
please share your thoughts as soon as posssible.



RE: Dynamically Changing the Testdata by using macros - basanth27 - 03-23-2011

Question 1: Yes macro is a possibility. But why use macro? You can do it through QTP. Write to excel using the Excel COM object.

Question 2: Objectrepositoryutil is an utility within QTP to programatically work with OR. You can step forward and traverse through the objects with the OR and modify their physical properties. However, instead of this tedious way, i suggest you use descriptive programming to dynamically change your object properties after iterations.


RE: Dynamically Changing the Testdata by using macros - nelmanoj - 03-23-2011

can you give the clear steps to write the excel using the COM object.


RE: Dynamically Changing the Testdata by using macros - basanth27 - 03-23-2011

If you would have searched this forum you would have got it in no time.


RE: Dynamically Changing the Testdata by using macros - nelmanoj - 03-23-2011

Hi Basant,
I searched in the forum but i could not get the code. can you provide url or the code here, if its possible.


RE: Dynamically Changing the Testdata by using macros - basanth27 - 03-23-2011

It is always better to learn forever then do it for today. If you go to www.learnqtp.com , on to your right bottom most you will find a section called QTP with Excel. It is a three part series and should ladder you through your objective.
I am on the cell phone and it is not at all easy to paste the entire hyperlink. Please excuse.