Micro Focus QTP (UFT) Forums
Calling reusable Actions from a Test WITHOUT having to interfere with the UI - 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: Calling reusable Actions from a Test WITHOUT having to interfere with the UI (/Thread-Calling-reusable-Actions-from-a-Test-WITHOUT-having-to-interfere-with-the-UI)



Calling reusable Actions from a Test WITHOUT having to interfere with the UI - ConstantChange - 04-02-2008

Hi all!

Even though I gave up hope in this:

Does anybody know whether its possible to call an external Action from a script without having to first using the "Insert - Call to existing Action" menu. I would like to decide dynamically which action to run, but that obviously does not work.

to make it clear, an example:

I open a new Test and write this line into the main action:

Code:
RunAction "LoginDealer [LoginLib]", oneIteration, "dealer1", "d1password"

If I run the test it will throw the error "Action not found".

If I now do the "Insert - call to existing action" stuff, refering to the same action, QTP will insert another line, so the script now will look like this


Code:
RunAction "LoginDealer [LoginLib]", oneIteration, "dealer1", "d1password"
RunAction "LoginDealer [LoginLib]", oneIteration


Now I delete the second line which was just inserted, so the script looks EXACTLY like before

Code:
RunAction "LoginDealer [LoginLib]", oneIteration, "dealer1", "d1password"

and if I run the test now it will work fine.

So, how can I avoid doing the insert shtuff?

Thanks a lot!
CC


RE: Calling reusable Actions from a Test WITHOUT having to interfere with the UI - niranjan - 04-03-2008

Unfortunately I dont think you can do that.
Please correct me if I am wrong.