Micro Focus QTP (UFT) Forums
Error -2147467259 - 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 Others (https://www.learnqtp.com/forums/Forum-UFT-QTP-Others)
+--- Thread: Error -2147467259 (/Thread-Error-2147467259)



Error -2147467259 - Prema - 10-11-2010

Hi,
I am getting this error while qtp clicks an edit button on the run time.

Details :
In the script
1. i am getting the total no.of rows from a table
2. then in the for loop getting the cell data upto the row count
3. then it need to click the edit button on the page (The page is containing 19 edit buttons) according to the value in the loop.

The code is:
Code:
Set desc = Description.Create()
desc("alt").Value = "Edit"
desc("html tag").Value = "IMG"
desc("image type").Value = "Image Link"
desc("name").Value = "Image"
desc("file name").Value = "edit.gif"
Set List =Browser("name:= Name").Page("title:= Name").ChildObjects(desc)     
NoOfChildObjs =  List.Count()
Rows = Browser("Browser").Page("Page").WebTable("Table Name").RowCount
Dim j
j=0
For i = 1  to Rows
row = DataTable.GetSheet("Global").GetCurrentRow
ConfigName = DataTable.GetSheet("Global").GetParameter("ConfigName").ValueByRow(row)
'msgbox ConfigName
If  ConfigName = "End"  Then
    ExitTest
else
Config = Browser("Browser").Page("Page").WebTable("Table Name").GetCellData(i,1)
msgbox Config
If  Trim(ConfigName) = Trim(Config)  Then
    j = i - 2
msgbox j
List( j).Click   (<- I am getting General Runtime error in this line while clicking the second object ie List(1).click from the child objects but the first iteration is going well ie List(0).click is working.)
msgbox Err.Number ( -214746259 error number is getting displayed)
Edit the text fields and the n click the update button
DataTable.GetSheet("Global").SetNextRow
End If
End If
Next

Can anybody help me on this.


RE: Error -2147467259 - KavitaPriyaCR - 10-11-2010

Hi

Can you give more info regarding this?
Is it recorded script or done by using descriptive programming?
Gve some script lines before invoking the click action.


RE: Error -2147467259 - Prema - 10-11-2010

Hi Kavita,

I have updated the message with the coding.
I used both the recording and DP in the script.

Regards
Prema


RE: Error -2147467259 - A.Saini - 10-11-2010

Hi Prema,

Please be more specific about your problem. Although you can try following things:

1) If it is a QTP error than restart your QTP & Application.

2) Please double check it manually whether it's an application error.

If the error still exits please give more detail & we will try to find out the reason.

Smile


RE: Error -2147467259 - KavitaPriyaCR - 10-11-2010

Hi Prema,
1. After the line
NoOfChildObjs = List.Count()
Check if NoOfChildObjs(1) exists or not, i mean add the below line and findout.
MsgBox NoOfChildObjs
2. Along with "MsgBox err.Number", also add "MsgBox.Description", let us see if we can get more information.
3. Tables you have mentioned:
"Rows = Browser("Browser").Page("Page").WebTable("Table Name").RowCount"
and
"Browser("Breeze Card").Page("Breeze Card_2").WebTable("Config Name").GetCellData(i,1)"
are they same? i mean, are you refering to the same table?


RE: Error -2147467259 - A.Saini - 10-11-2010

Hi Prema,

Sorry, as I got your updated code little late.

The main points which I could understand from your code are:

a) If the parameter "ConfigName" (coming from Data Table) is not equal to "End" than you are taking the cell data of first Colum for each row of the web table.

b) Now you are doing a comparison b/w the data (Trim) of data table & web table. If data is same, than you are clicking over List (currentRow-2).

c) Now you are editing the text fields and then clicking over update button.

Please let me know if I am wrong. The little doubt I have is: "Does the "Image link" available in each row of table or it depends on the data?"

Smile


RE: Error -2147467259 - Prema - 10-11-2010

Hi,
I restarted the QTP and application still the problem exists.
The script scenario is
The page is having some rows of record say 19 in a grid, each row is having an edit button to update values in the record.
I need to automate the scenario that the records need to be updated will be given in the QTP datatable so the script should click the edit button of the appropriate record then update the values and save the changes.

For the above scenario i followed the steps
1.Open the specified page
2.Get the child objects for specified property(ie List).
3.Get the row count of the web table where the records are.
4.In the for loop i = 1 to row count
i .Get the value from the QTP Datatable by ValueByRow(row) and assign it to variable say a.
ii. Get value of the cell by getcelldata(i,1) and assign it to variable say b
iii.Compare whether a and b are equal if so then click the corresponding child object (edit button) through the command List(j).click( Since j = i-2 as the row in the web table is heading).
iv. Update the values.
v. Set the next row in the QTP datatable untill the row count.

Note: while executing the script for the first row of record from the QTP table the object (List(0)) is get clicked and updated
on the second row of record it throws a Run Error msgbox on clicking the (List(1)) ( ie j = i - 2 )object but the script is able to click the List(1) object if it is not defined with a variable.

Also is there any other way to automate the above scenario? .
Regards
Prema.

Hi A.Saini,
Yes,your understanding is correct.
Also the "Image link" is available for every row inside the grid.


RE: Error -2147467259 - Prema - 10-11-2010

Hi Kavita,
I included the 'MsgBox ("Error # " & CStr(Err.Number) & " " & Err.Description)' statement after the 'MsgBox err.Number'
but the empty message box showing.