def __set_last_page_screenshot(self):
if not self.__last_page_screenshot and (<EOL>not self.__last_page_screenshot_png):<EOL><INDENT>try:<EOL><INDENT>element = self.driver.find_element_by_tag_name('<STR_LIT:body>')<EOL>if self.is_pytest and self.report_on:<EOL><INDENT>self.__last_page_screenshot_png = (<EOL>self.driver.get_screenshot_as_png())<EOL>self.__last_page_screenshot = element.screenshot_as_base64<EOL><DEDENT>else:<EOL><INDENT>self.__last_page_screenshot_png = element.screenshot_as_png<EOL><DEDENT><DEDENT>except Exception:<EOL><INDENT>if not self.__last_page_screenshot:<EOL><INDENT>if self.is_pytest and self.report_on:<EOL><INDENT>try:<EOL><INDENT>self.__last_page_screenshot = (<EOL>self.driver.get_screenshot_as_base64())<EOL><DEDENT>except Exception:<EOL><INDENT>pass<EOL><DEDENT><DEDENT><DEDENT>if not self.__last_page_screenshot_png:<EOL><INDENT>try:<EOL><INDENT>self.__last_page_screenshot_png = (<EOL>self.driver.get_screenshot_as_png())<EOL><DEDENT>except Exception:<EOL><INDENT>pass<EOL><DEDENT><DEDENT><DEDENT><DEDENT>
self.__last_page_screenshot is only for pytest html report logs
            self.__last_page_screenshot_png is for all screenshot log files