Joshua S_1 Absent Member.
Absent Member.
770 views

QTP DataTable.LocalSheet does not exist

I am using QTP 9.1 with QC 9.2 using business components to create BPT's. I just had an issue (it has happened 1 or 2 other times in the 6 months we have used the products) where I cannot add a parameter to the my datatable because DataTable.localSheet cannot be evalutated. Since I am using components, there is no globalSheet. It seems like it is a data corruption error - maybe the component did not get saved correctly? Any ideas how to fix it? The only thing I can think to do is copy the code, and make a new component, put the parameters in there, and paste the code. Then I have to change out the old component in all 12 scripts that use it, and make sure each has the correct inputs. I also get "Error # -2147467259" in my debug log, the error has no description or source - but it occurs when I try
r = DataTable.localSheet.AddParameter(NewField, " ").name
and only for this component. Also when I open the component, instead of showing the component name as the sheet name, it just says Sheet1. Any info as to why this happened, how to prevent it, or how to update all the BPT's would be appreciated. Thanks.
0 Likes
4 Replies
Joshua S_1 Absent Member.
Absent Member.

Re: QTP DataTable.LocalSheet does not exist

Hmm, no suggestions? I guess I will go ahead and change out the components, and hope it does not happen to a really common component.
0 Likes
Highlighted
Absent Member.. Babji Absent Member..
Absent Member..

Re: QTP DataTable.LocalSheet does not exist

Hi Joshua S,

Scripted components contain only one datatable. i.e., LocalDatatable... In Scripted component the datatable shows with the component name, even it shows there but it consider that as a sheet1 localsheet.

Here, you can make the test parameterize by passing values by datatable or from TestSettings --> Parameters (Input and Output parameters).

Datatable.addparameter("ParName",dtLocalsheet)
var = Datatable.value("ParName",dtLocalSheet)

If you use input/output parameters
parameter.value("ParName")= var
var = parameter.value("ParName")

above syntax's will work.

parameterization can be done for a scripted component in QTP.

runtime parameterization for the component should be done in QC Test Lab.

even if you parameterize the test in QTP by datatable. Those will not be displayed while running the component from QC and even the reports doesn't contain parameter values.
0 Likes
Joshua S_1 Absent Member.
Absent Member.

Re: QTP DataTable.LocalSheet does not exist

Yes, I understand how all the parameterization works. The problem I had here was that QTP was not recognizing the DataTable. The problem turned out to be a QC/QTP bug caused by me changing the component name. If you change the component name in QC, but only change the case, it will cause this issue. For example:

Original Name: My cOmponent
New Name: My Component

If I need to change the case now, I change the name to something completely different, then change it again to the correct name.
0 Likes
Joshua S_1 Absent Member.
Absent Member.

Re: QTP DataTable.LocalSheet does not exist

See solution above.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.