def _take_screenshot(self, window=None):
screenshot_name = self._get_next_screenshot_name()<EOL>screenshot_file_name = self._get_screenshot_session_file_name(screenshot_name)<EOL>if window is not None:<EOL><INDENT>window.switch_to()<EOL><DEDENT>get_buffer_manager().get_color_buffer().image_data.save(screenshot_file_name)<EOL>self.screenshots.append(screenshot_name)<EOL>self._schedule_commit()<EOL>return screenshot_name<EOL>
Take a screenshot to allow visual verification.