Micro Focus QTP (UFT) Forums
How to Automate Datatable column name and sheetname in function - 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: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: How to Automate Datatable column name and sheetname in function (/Thread-How-to-Automate-Datatable-column-name-and-sheetname-in-function)



How to Automate Datatable column name and sheetname in function - syednaqvi - 06-06-2017

Hello,

I am new here. I am working on a script with function library. I have created following function. 

Code:
'Function to Validate Login
Function fnChktext (Prop_Name,Prop_InnerText)
Dim Chktext
Set Chktext=Description.Create
Chktext("name").value=Prop_Name
Chktext("innertext").value=Prop_InnerText
If MyBrowser.Link(Chktext).Exist(2) Then
DataTable.Value("Results", "Global")="Test-Passed"
Else
DataTable.Value("Results", "Global")="Test-Failed"
End If
End Function


I want to reuse this function but I want user should enter ColumnName and Sheetname for DataTable to write values to DataTable. Instead of making it hard coded for column name and Sheetname. How Can I do this?


RE: How to Automate Datatable column name and sheetname in function - Ankur - 06-07-2017

You mean you want a test engineer's intervention while the script is running? So that a script is paused and (s)he can enter the value of column and sheet name?