Listener to push robotframework execution results to MySQL (for Robotframework Historic report)
-
Install
robotframework-historic-listener
pip install robotframework-historic-listener
Robotframework Historic report required following information, users must pass respective info while using listener
- SQL_HOST --> mysql hosted machine ip address (default: localhost)
- SQL_USER_NAME --> mysql user name (default: superuser)
- SQL_PASSWORD --> mysql password (default: passw0rd)
- RFH_PROJECT_NAME --> project name in robotframework historic
- RFH_EXECUTION_NAME --> execution info
-
Use
robotframework-historic-listener
while executing tests> robot --listener robotframework_historic_listener.Listener -v SQL_HOST:"<SQL_HOSTED_IP:3306>" -v SQL_USER_NAME:"<NAME>" -v SQL_PASSWORD:"<PWD>" -v RFH_PROJECT_NAME:"<PROJECT-NAME>" -v RFH_EXECUTION_NAME:"<EXECUTION-INFO>"
Example:
> robot --listener robotframework_historic_listener.Listener -v SQL_HOST:"10.30.2.150:3306" -v SQL_USER_NAME:"admin" -v SQL_PASSWORD:"Welcome1!" -v RFH_PROJECT_NAME:"projec1" -v RFH_EXECUTION_NAME:"Smoke test on v1.0" <suite>
-
Create variable file like
config.py
-
Place all variables info
# MYSQL location ie., localhost or 127.0.0.1:18007 etc., SQL_HOST = "localhost" # Database and its credentials SQL_USER_NAME = "superuser" SQL_PASSWORD = "passw0rd" RFH_PROJECT_NAME = "projectname" # Execution details RFH_EXECUTION_NAME = "Smoke Test on v1.0"
-
Use variable file while using listener
> robot --listener robotframework_historic_listener.Listener -V config.py <suite>
For more info refer to robotframework-historic