How to call a script/procedure from another script?

Post here if you need help using Actiona
Post Reply
skippy
Posts: 4
Joined: 21 Feb 2017, 11:42

How to call a script/procedure from another script?

Post by skippy »

Hello everybody!

I started using Actiona to automate my application testing and I like it
very much!

Each of my scripts is required to do a number of similar tasks, e.g. writing
results of execution into a file. I don't like to repeat myself and also would
like to simplify maintenance of the scripts. Therefore I would like to create a
"shared library", i.e. set of scripts which will be included or called from
each of my scripts. My challenge is that I don't know how to call an Actiona
script or procedure form another Actiona script. Can anybody help me with that
please? Or is there any workaround for my case?

Thanks a lot in advance!
francois
Posts: 456
Joined: 18 Oct 2010, 10:33
Location: France

Re: How to call a script/procedure from another script?

Post by francois »

Hello,

A similar question was asked on the forum in French:
As in php, you can do include.

The included script must contain javascript.
And as with php, we can do include in include.

On the other hand, you can not include an actiona script in an actiona script.
(One includes in a code action, so code is needed)

In use, this is well suited for actions (or groups of actions) common to several scripts.
skippy
Posts: 4
Joined: 21 Feb 2017, 11:42

Re: How to call a script/procedure from another script?

Post by skippy »

Hello Francois,

To sum you response up:
1) It is NOT possible to cal an Actiona script from another Actiona script
2) It IS possible to call 1 JavaScript from multiple Actiona scripts

I.e. the solution would be to create and "shared library" in pure JavaScript and implement all the shared functionality in it.

Did I understand you correctly?
francois
Posts: 456
Joined: 18 Oct 2010, 10:33
Location: France

Re: How to call a script/procedure from another script?

Post by francois »

Hello,

I.e. the solution would be to create and "shared library" in pure JavaScript and implement all the shared functionality in it.
it's exactly that.

documentation :
https://wiki.actiona.tools/doku.php?id= ... ore:global
skippy
Posts: 4
Joined: 21 Feb 2017, 11:42

Re: How to call a script/procedure from another script?

Post by skippy »

Thnaks a lot for your reply, I will use it!

One more idea:
Is it possible to have a "command" action that will call another Actiona script from CLI via actexec?
Post Reply