Website Automation in OpenBots Studio
The goal of this automation will be to open a hashing website, enter a user supplied message, and write the generated hash in a text file.
In OpenBots Studio, create a new project. There will already be a placeholder command in the automation. Delete that command using the delete key on your keyboard, as we won’t be using it.
In the Commands tab, search for the Prompt for Input command. Modify the Header Name and Input Directions fields as needed.
Then, under Input Parameters, click Add Input Parameter. Select the TextBox option for Input Type. In the Assigned field, you must indicate the variable you wish to store the message in. Create the variable by adding curly braces around the variable name. Click OK to add the command to the automation.
Search for the Create Browser command. Indicate the Web Browser Instance and the Browser Engine Type. Then, enter the URL to the hashing website. Indicate whether the Browser Instance should be forgotten or kept alive, and select the window state. Click OK to add the command to the script.
Search for the Element Action command. We will use the Element Recorder to capture the element search parameter. Navigate to the website and enable the Stop Recording on First Click option. Start recording and replicate the steps that need to be performed.
In OpenBots Studio, an element should’ve been created and the parameter fields should’ve automatically been filled in. Under Element Action, select Set Text. In the Text to Set field, enter the name of the variable that you created earlier. Click OK to add the command to the automation.
Add another Element Action command. Use the Element Recorder as described before to record yourself clicking the Generate button on the hashing website. Under Element Action, select the Left Click action. Click OK to add the command to the automation.
Add another Element Action command to grab the generated text. This time, we will grab the element’s XPath manually. Open the Chrome window, right click on the hash, and press Inspect. Right click on the highlighted text, press Copy, and press Copy XPath. Paste the copied XPath into OpenBots Studio.
Select Get Text under Element Action. Use curly braces to create a new variable in the Action Parameters field. Click OK to add the command to the script.
Use the Close Browser command to close the Browser Instance that you created.
Search the Write/Create Text File command. Select the ProjectPath variable in the Text File Path field. In the Text field, enter the name of the variable you created to store the extracted hash. Overwrite any existing text and click OK to add the command.
Run the automation to ensure that everything is working. Refresh the Project Folder and check that the text file is there.
Congratulations! You successfully created a website automation!