Search code examples
vbscripthp-uft

Make uft function read datatable consonant parameter from jenkins


I'm new at programming and started to learn how to work whit UFT (whit vb script) and Jenkins. I'm trying to pass a parameter so the function created gets the data from excel file, accorded the parameter. At sheet one we have Particular users, and at sheet two we have business users.

I know we can set an Input Parameter, but i don't know exactly how this works so it changes the type at the function, and how to configure Jenkins to send these parameters when running the build.

Basically if function is:

Getuser(type)

If Type = "P" Then      
DataTable.ImportSheet LocalFicheiros & "LOGIN\input.xlsx", "Particular", "Global"
Else

DataTable.ImportSheet LocalFicheiros & "LOGIN\input.xlsx", "Business", "Global"

End If

Read a lot about this, but started to get confused to me.


Solution

  • I've done this by using a vbscript which creates the UFT instance and runs the required test. Jenkins uses a cscript call to execute this script. The vbscript accepts the parameters in the call from Jenkins and passes them into the UFT script (using the ParametersCollection of the created instance) which is configured to accept the input parameters and pass them into the appropriate actions.