I want to check in the data table(Globalsheet) column exist
or not through script .If column not exist only proceeded
to next step Pls tell me how to proceeded?
Answer Posted / drew
Answer 1 is good if you don't have a lot of data to write to
the data table. I sometimes have 20 columns to write to and
to check for the column each time before writing the data
can take 2 or more seconds each (40 seconds for the entire
row)...way to long if doing a repetitive task.
Answer 3 won't work because you will get a QTP error on the
line "Val = DataTable("UserId", dtGlobalSheet)" if the
column doesn't exist. But you can use that error to make a
very speedy function to find out if the column exists:
If COM_DoesDataTableColumnExist("Global","Column1") Then
''Column Exists
Else
''Column Does Not Exist
End If
Public Function COM_DoesDataTableColumnExist(ByVal
strSheetName,ByVal strColumnName)
Dim blnReturnValue
Dim strTestColumn
Err.Clear
On Error Resume Next
strTestColumn =
DataTable.GetSheet(strSheetName).GetParameter(strColumnName).Name
If Err <> 0 Then
blnReturnValue = False
Else
blnReturnValue = True
End If
Err.Clear
COM_DoesDataTableColumnExist = blnReturnValue
End Function
Is This Answer Correct ? | 21 Yes | 5 No |
Post New Answer View All Answers
what kind of frame work you used in your last project?
How to connect the remote desktop using QTP 9.2 explain the method or procedure?
Dear All, How to generate Pass or Fail Report in QTP without using Reporter.Report Event Method ? Thanks Balaji
What is the difference between run time object and test object in QTP?
What is output value? How many types of output values are there in qtp?
How you know that a test case is a regression test case
Explain the concept of how quicktest professional (qtp) identifies object?
What is the use of ordinal identifier in qtp?
How do you configure QTP AND Test director?
suppose in the middle of the project QTP will not work properly, then what do u do? and ur team?
how to use the QTP choose the data from oracle? e.g. i input the identity card NO. this will be add new record in the database ,and now i want get this record's prime key.
How many types of trigger events are there in qtp?
i want information about API testing and i want info like how process can be done in company? i want added info like coding ,debugging, desing in c.v ? what should add in c.v for eg banking domin? pls any answer my question?
Hoe can we do retesting using functions please give the code for it using login page
What is TOM in QTP?