Browser Automation Studio Tutorial: Lesson #1 Call Functions

One of the easiest ways to organise a large script on Browser Automation studio is via “Functions”. This way you can separate different stages of a script. For instance, if you created an account management tool for Instagram, you could automate the login, then check if the account is alive, then upload an image from a folder all in separate functions.

In the main section of the BAS recording studio, you can reference those functions in order. This is helpful for keeping everything neat, easy to find for bug fixes, AND if you want to repeat an action several times in one script, you don’t have to copy the code several times. Which will become a nightmare if there’s a website update, since you’d have to update a script many times instead of once.

This is how to create functions and reference them

Click main in the recording studio

Click the Red circle to add a new function

Click this icon

Give it a name and click OK

Save changes

Now you’ll see this newly created function appear at the bottom. Every action you record here will be saved to that function.

If you click function name at the bottom, it will bring up the list of all your other created functions

Click on Script logic or search for “Call Function” in “What to search?”

Click Call function

Click inside the function name box, then click Select function

Click your newly created function

Click OK

You will now see the function in your “main” script section. When you click the run button, it will play everything in the main section. If you have multiple call functions i.e. Introduction and Function Name from the image below. It will execute the actions in Introduction, then everything in FunctionName.



Please follow and like us:

Leave a Reply

Your email address will not be published. Required fields are marked *