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 do you mean by checkpoints in qtp?
How to interact tool & application build in QTP?
How you can decide which type of object repository you have to use?
Explain about Test Fusion Report of QTP?
Step 3&4 are repeated until an the object in recognised uniquely.
I created 3 actions in test suppose I want to run action 1 in single time, action 2 is 4 time what I do?
if anyone has idea of the interview procedure in covansys, plz send me a mail?
In Remote acess server how u run a test?
What are the features of quick test pro(qtp)?
What are the advantages of qtp?
I have many listboxes in my application. I have to check whether the contents inside the listboxes are in sorted order or not..can anyone please send the code as early as possible
Can any one tell me about "Mapping Repository Parameter Values" and why we use it....??How to use it???Please, tell the preconditions also...........???? Thanks in Advance
can any boby tell me what is method or steps to connect the remote desk top by using QTP 9.2 version?
What is an expert view and keyword view?
Hi any body pls help me for QTP 11.0 software free demo version. i have to practice. Kindly send the link.or where i have to download.