Posts: 8
Threads: 4
Joined: Aug 2010
Reputation:
0
03-30-2011, 04:52 PM
Say I have a QTP script which contains several reusable actions. The Global Datasheet contains a few parameters that are used by the other actions. So I want to pass these parameters between the actions’ datasheets. So logically I followed basic Excel functionality and did a point and click from one of the local datasheets to the global datasheets cell that I require. This works giving the following formula =Global!A1
A1 being the cell that I wanted to get the value of (i.e. Column A, Row 1).
However I will be reading in the Global Datasheet and the column headings may or may not reflect the “A” title. Therefore is it possible to re-write this formula (=Global!A1) so that it takes the column title that I have created in QTP? Eg. pUsername.
I logically tried to just do the following, but QTP did not like these:
=Global!”pUsername”1
=Global!pUsername1
I am looking for a solution to the above rather than alternative solutions, as I do have reasons for wanting to do it this way and I am aware that I could just take the parameter values from within the action.
Any help would be greatly appreciated.
Posts: 8
Threads: 4
Joined: Aug 2010
Reputation:
0
03-31-2011, 01:24 PM
Thanks tdevick, but thats not quite what I am looking for. This is what I have done:
1. In the Global Datasheet I have renamed column 'A' to 'pUsername'.
2. In the Local Datasheet of my action I have selected cell A1 (column 1, Row 1).
3. I then enter '=' into that cell, then go to the global datasheet and select cell one of the column 'pUsername' and the press enter.
4. A formula is generated automatically by QTP which is '=Global!A1'.
So my localsheet is now reflecting the contents of the globalsheet, which is what I desire...
But I don't want the formula to be A1, I want it to be pUsername1. As the "A" aspect may not always be true as I may have other global parameters so it could be B1, C1 etc.
So I am looking to see if their is a way to reword the formula within the datasheets cell to have 'pUsername' instead of using 'A'.
Hope this helps make my goal more clear.
Posts: 24
Threads: 7
Joined: Mar 2011
Reputation:
0
03-31-2011, 08:54 PM
This is an interestinging Question.
Experts, please correct me if I am wrong, I believe "pUsename" is a LABEL used within a particular Datasheet and is always located on the First Row of the datasheet / Worksheet in Excel. QTP logically interprets it as a Column Name instead of using Excel Column Name.
If you try to open the Excel Doc externally, you will be able to view my explanation. Hence '=Global!A1' is correct the value is being worksheet "Global" Cell "A1". I believe Excel will not recognize as Column "A" unless you rename the Column naming convention within Excel.
Experts, please pitch in your comments if I am wrong. I would also like to understand the internal to this.
Thanks,
Subha
Posts: 1,003
Threads: 1
Joined: Jul 2009
Reputation:
5
03-31-2011, 09:11 PM
Suba -
Yes. That is correct. However, i still have hunch that it could be a possibility and i have been looking through excel forums to see if we can make it happen. One of the shortcomings of datasheet trying to clone excel.
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: 24
Threads: 7
Joined: Mar 2011
Reputation:
0
04-01-2011, 06:59 PM
Thanks Basanth.
There was typo in my previous reponse. Correction as below.
If you try to open the Excel Doc externally, you will be able to view my explanation. Hence '=Global!A1' is correct the value is being worksheet "Global" Cell "A1". I believe Excel will not recognize as Column "A" unless you rename the Column naming convention within Excel.
CORRECTION:
If you try to open the Excel Doc externally, you will be able to view my explanation. Hence '=Global!A1' is correct the value is being worksheet "Global" Cell "A1". I believe Excel will not recognize as Column "pUsename" unless you rename the Column naming convention within Excel.
Thanks,
Suba