Tricentis Tosca 16.0 Released on Feb-2023 ----- UFT has been upgraded from UFT 15.0.1 to UFT One 15.0.2, Beginning at November 2020.

Wednesday 3 June 2015

Code for Checking if given parameter is exists or not in DATATABLE.

Function isParameterExists(sheetName, paramName)
    isParameterExists = FALSE
    ParamTotal = DataTable.GetSheet("Global").GetParameterCount

    For i = 1 To ParamTotal
       value = DataTable.GetSheet("Global").GetParameter(i).Name
       Msgbox value
   
       If strComp(paramName,value)=0 Then
          isParameterExists=TRUE
          Exit Function
       End if
    Next
 
End Function


If isParameterExists("Global","hh"then
   msgbox "Patameter exists"
Else
   msgbox "Patameter does not exist"
End if 


or

on error resume next
val=DataTable("ParamName",dtGlobalSheet)
if err.number<> 0 then     
   Print Parameter does not exist
else      
   Print Parameter exists
end if