pyATS Robot Framework Module
raw JSON → 26.3 verified Mon Apr 27 auth: no python
The pyATS Robot library provides a Robot Framework interface for Cisco pyATS (Python Test Automation Framework), enabling users to write test cases in Robot Framework syntax while leveraging pyATS test infrastructure. Current version is 26.3, released as part of the pyATS ecosystem. The library follows pyATS release cadence, updating approximately quarterly.
pip install pyats-robot Common errors
error ModuleNotFoundError: No module named 'robot' ↓
cause Robot Framework is not installed or not in the Python environment.
fix
Run 'pip install robotframework' to install Robot Framework.
error AttributeError: module 'pyats.robot' has no attribute 'Robot' ↓
cause Incorrect import statement (e.g., 'from pyats import robot'), or older version of pyats-robot.
fix
Use 'from pyats.robot import Robot'. Upgrade pyats-robot via 'pip install --upgrade pyats-robot'.
error Robot Framework test fails: 'No keyword with name ... found' ↓
cause Missing import of pyATS libraries in the Robot test file.
fix
Add 'Library pyats.robot.libraries.DeviceLibrary' and other needed libraries in the '*** Settings ***' section.
Warnings
breaking pyATS Robot 26.x requires Python 3.8+; Python 2.7 support dropped in earlier versions. ↓
fix Ensure Python >=3.8 is used. Upgrade Python if on an older version.
deprecated The 'pyats.robot.Robot' class's 'run' method may require explicit Robot Framework library imports in test files; implicit imports deprecated. ↓
fix Add 'Library pyats.robot.libraries.*' in Robot test files explicitly.
gotcha Testbed YAML files must be referenced correctly; pyATS Robot does not automatically load testbed from environment variable. ↓
fix Pass the testbed path explicitly via '--testbed-file' argument or set 'PYATS_TESTBED' environment variable.
Imports
- Robot wrong
import robotcorrectfrom pyats.robot import Robot - TestCase
from pyats.robot.testcase import RobotTestCase
Quickstart
from pyats.easypy import run
from pyats.robot import Robot
def main():
robot = Robot()
robot.run('tests/my_test.robot')
if __name__ == '__main__':
main()