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 are the frame work models of qtp?which frame work you follow in your company?and explain it process?
tell me exact differenceb bw qtp and selenium?(could not tell open soure and licennce? difference in usage and technical difference?
What is synchronization point in QTP?
what is clean sweep?
What test you perform mostly? Regression or retesting in your testing process?
what could go wrong with test automation?
what is clean sweep?
If we put all properties in mandatory and assistive list of Normal Identification, Do we still need Smart?
Dear Friends, I having total 3+year experience in manual testing including automation testing QTP, if i am attending any interview what kind of question will i get? please help me out
What is quick test pro? What is a quick test professional?
How can we retrieve the Bug Ids which are open&Reopen in status through QTP scrit?Please find the script which i tried... Dim objBugFactory, objBug Dim BugId Set TDConnection = QCUtil.TDConnection Set objBug = TDConnection.BugFactory If QCUtil.IsConnected then Reporter.ReportEvent 0, "Connected", "Connected to server: " + QCUtil.TDConnection.ServerName + chr (13) +"Project: " + QCUtil.TDConnection.ProjectName + chr (13) + "Domain: " + QCUtil.TDConnection.DomainName Reporter.ReportEvent 0, "Current time on server is","==>" & TDConnection.ServerTime Else Reporter.ReportEvent 1, "Not connected", "Not connected to Quality Center" End If If mybug.Status="Open" Then BugId=mybug.DefectId MsgBox BugId End If 'OR**********************************--------------------- -----********************************** If Bug_Fields("BG_STATUS").Value ="Open" Or "Re Open"Then BugId=Bug_Fields("BG_BUG_ID").Value MsgBox BugId End If
Is the qtp course will help to create a virtual object?
For which type of project the iterative model is suitable?
What is object spy in quicktest professional?
hai, i completed my b.tech in 2010 with 62.3%. i having knowledge on manual testing and Qtp. i want Relavent experience in testing.watever may be d salary i dont bother..I just want to gain knowledge. i dont have good communication skills.