diff --git a/odoo/tests/common.py b/odoo/tests/common.py index 03d3a1bf8c7..0dd1d5eb608 100644 --- a/odoo/tests/common.py +++ b/odoo/tests/common.py @@ -1343,12 +1343,15 @@ which leads to stray network requests and inconsistencies.""" def _handle_screencast_frame(self, sessionId, data, metadata): self._websocket_send('Page.screencastFrameAck', params={'sessionId': sessionId}) outfile = os.path.join(self.screencasts_frames_dir, 'frame_%05d.b64' % len(self.screencast_frames)) - with open(outfile, 'w') as f: - f.write(data) - self.screencast_frames.append({ - 'file_path': outfile, - 'timestamp': metadata.get('timestamp') - }) + try: + with open(outfile, 'w') as f: + f.write(data) + self.screencast_frames.append({ + 'file_path': outfile, + 'timestamp': metadata.get('timestamp') + }) + except FileNotFoundError: + self._logger.debug('Useless screencast frame skipped: %s', outfile) _TO_LEVEL = { 'debug': logging.DEBUG,