Recorder¶
The BotCity Recorder plugin allows you to record your Bot actions in a video.
It works with Desktop as well as Web automations, even in headless mode.
This is extremely useful for debugging, documenting and testing your Bot.
Installation¶
Importing the Plugin¶
After you installed this package, the next step is to import the package into your code and start using the functions.
Recording a Bot¶
To add the recorder we just need to perform 3 simple steps:
- Instantiate the Plugin
- Invoke the Start method
- Invoke the Stop method
Instantiate the Plugin¶
Starting and Stopping the Recording¶
Complete Example¶
from botcity.core import DesktopBot
from botcity.plugins.recorder import BotRecorderPlugin
def main():
# Instantiate the DesktopBot
bot = DesktopBot()
# Define the URL with the search term `countdown timer 5 minutes`.
url = "https://www.google.com/search?q=countdown+timer+5+minutes"
# Instantiate the recorder with the bot and file
recorder = BotRecorderPlugin(bot, "test.avi")
# Start recording
recorder.start()
# Invoke the browser to open the URL.
bot.browse(url)
print("Waiting for a little bit...")
bot.wait(10000)
# Stop the recorder
recorder.stop()