Script Basics
RPA scripts in Granite use the Robocorp framework with Python.Minimal Example
@task decorator marks the entry point.
Browser Automation
Desktop Automation
Excel Automation
Error Handling
Waiting for Elements
Best Practices
Use explicit waits
Use explicit waits
Don’t use
time.sleep() everywhere. Use wait_for_element or wait_for_text for reliability.Handle errors gracefully
Handle errors gracefully
Wrap risky operations in try/except. Take screenshots on failure.
Use meaningful names
Use meaningful names
Name functions and variables clearly. Future you will thank you.
Test incrementally
Test incrementally
Build and test one step at a time. Don’t write the whole script first.