Reloading test libraries after code changes at runtime
337 views
Skip to first unread message
vbs
unread,
Jan 14, 2016, 11:22:31 AM1/14/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to robotframework-users
Gentlemen,
I have a couple of custom test libraries. Also I have a continuously running python server that executes test cases on demand by invoking rebot() from inside python code.
The problem is:
When I change the code inside my test libraries then rebot doesn't make use of these changes. So it is running the code it initially started with. How can I force robot framework to reload all test libraries when (or before) I call rebot?
I noticed that since RF 2.9 there is BuiltIn.ReloadLibrary keyword:
But I am not sure if that is what I need. I can only reload a single library it seems. Also there is the python 'reload' function to refresh a module. But I didn't find a good way to use it either.
Has anybody ideas how to do this in a clean way?
I am on RF 2.9.7
Thank you guys
Robin
Pekka Klärck
unread,
Jan 15, 2016, 4:50:19 AM1/15/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to robin...@gmail.com, robotframework-users
Hello,
It is always problematic to reload Python modules because they are
cached in sys.modules. In addition to that, Robot has its own internal
caches. I would recommend you to enhance your server to allow
restarting it when there are changes to libraries. You could even make
restart automatic by polling are there changes to libraries.