I recently discovered fileviewer.py and I love it. I have been searching for a
tail -f equivalent in windows .. and more importantly I was searching for something that I could include with my test repository and launch as part of the test runs. As I have some rudimentary screen capture setup to run with the test runs, this will be great to debug test failures .. as I cannot only see what selenium is doing in the browser but also watch the corresponding debug.log messages to see what keywords are being executed etc.
I did the following in my test runner script:
...
from robot import fileviewer
test_proc = Process(target=robot.run, ...)
test_proc.start()
debug_log_viewer = fileviewer.FileViewer(os.path.abspath(os.path.join(output_dir, 'debug.log')))
debug_log_viewer.mainloop()
test_proc.join()
debug_log_viewer._root.quit()
debug_log_viewer._root.destroy()
Things work mostly as expected. The fileviewer is launched with real time updates to debug.log and I have the browser running the tests by the side.
The problem is after the test execution is complete, I am not able to get back control to my code.
It seems like debug_log_viewer.mainloop() keeps on executing. When I manually click Quit on the fileviewer GUI, then the control comes back to my script.
I would like to automate this last step of quitting the fileviewer application so that I can have this as part of my Continuous integration process.
Can someone help me please.
I tried starting the fileviewer in a separate process. But seems like Tkinter apps have a problem of playing nicely with multi processes. I started in a thread, but I don't think I can .terminate() a thread like I can do a process.
I would like to do this programmatically and not have another application (Sikuli ..etc) clicking the GUI quit as a solution.