diff --git a/src/ImageHorizonLibrary/recognition/_screenshot.py b/src/ImageHorizonLibrary/recognition/_screenshot.py index 3738b67..90e125c 100644 --- a/src/ImageHorizonLibrary/recognition/_screenshot.py +++ b/src/ImageHorizonLibrary/recognition/_screenshot.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -from os.path import abspath, join as path_join +from os.path import abspath, relpath, join as path_join from random import choice from string import ascii_lowercase @@ -43,6 +43,8 @@ def take_a_screenshot(self): '"%s"' % target_dir) path = self._make_up_filename() path = abspath(path_join(target_dir, path)) + logpath = BuiltIn().get_variable_value('${OUTPUT DIR}') + relativepath = relpath(path, start=logpath).replace('\\', '\/') LOGGER.info('Screenshot taken: {0}
'.format(path), html=True) + 'width="100%" />'.format(relativepath), html=True) ag.screenshot(path)