4

I have a function DetermineTree() in a function library called Explorer.vbs and another function with the same name, DetermineTree(), in Datasheets.vbs. From my Action I am calling a function that will eventually call DetermineTree(). I want to specify that I want to call DetermineTree() from Explorer.vbs NOT the one from Datasheets.vbs

I realize that if i change the order the libraries are associated it will solve the issue but I am looking for a code fix to this problem.

in C# I think you can specify using dot notation, ex. Explorer.DetermineTree()

Alvaromon
  • 190
  • 2
  • 16

2 Answers2

3

I assume you don't have the option of changing your function libraries to give these functions unique names (this would be the cleanest solution).

AFAIK in VBScript a function doesn't "remember" which script file it came from, so there's no way to disambiguate these functions without changing the files. The latest file evaluated will override the previous functions with the same name.

A hacky solution for your problem can be to use LoadFunctionLibrary before calling the function so as to ensure that the correct function library has final say as to which function to use.

Motti
  • 110,860
  • 49
  • 189
  • 262
0

You may read this further to understand which function would be called first (the order) - Why only the latest function is called, if the function name are same in UFT 12.02?

Pranav
  • 437
  • 3
  • 19