Refactoring how to caputure screenshot or page content
Change capturing timing.
Support capturing log file.