def METHOD_NAME(self):
    window = self.locals.get('window')
    if not window:
        self.logger.warning("Cannot take screenshot, window is not found in locals")
    else:
        app_tester_dir = self.locals.get('app_tester_dir')
        screenshots_dir = Path(app_tester_dir or os.getcwd()) / "screenshots"
        self.logger.info(f"Creating screenshot in {screenshots_dir}")
        METHOD_NAME(window, screenshots_dir)