|
2 | 2 | # Apache License 2.0, Copyright 2020 Tebel.Automation Private Limited |
3 | 3 | # https://github.com/tebelorg/RPA-Python/blob/master/LICENSE.txt |
4 | 4 | __author__ = 'Ken Soh <[email protected]>' |
5 | | -__version__ = '1.24.0' |
| 5 | +__version__ = '1.24.1' |
6 | 6 |
|
7 | 7 | import subprocess |
8 | 8 | import os |
@@ -900,12 +900,9 @@ def exist(element_identifier = None): |
900 | 900 | print('[RPA][ERROR] - page.png / page.bmp requires init(visual_automation = True)') |
901 | 901 | return False |
902 | 902 |
|
903 | | - # pre-emptive check for existence of specified image file for visual automation |
| 903 | + # pre-emptive checks if image files are specified for visual automation |
904 | 904 | if element_identifier.lower().endswith('.png') or element_identifier.lower().endswith('.bmp'): |
905 | | - if not os.path.isfile(element_identifier): |
906 | | - print('[RPA][ERROR] - missing image file ' + element_identifier) |
907 | | - return False |
908 | | - elif not _visual(): |
| 905 | + if not _visual(): |
909 | 906 | print('[RPA][ERROR] - ' + element_identifier + ' identifier requires init(visual_automation = True)') |
910 | 907 | return False |
911 | 908 |
|
@@ -1088,20 +1085,13 @@ def select(element_identifier = None, option_value = None, test_coordinate1 = No |
1088 | 1085 | option_value = coord(test_coordinate1, test_coordinate2) |
1089 | 1086 |
|
1090 | 1087 | # pre-emptive checks if image files are specified for visual automation |
1091 | | - # eg without below checks, a missing image file for option will crash |
1092 | 1088 | if element_identifier.lower().endswith('.png') or element_identifier.lower().endswith('.bmp'): |
1093 | | - if not os.path.isfile(element_identifier): |
1094 | | - print('[RPA][ERROR] - missing image file ' + element_identifier) |
1095 | | - return False |
1096 | | - elif not _visual(): |
| 1089 | + if not _visual(): |
1097 | 1090 | print('[RPA][ERROR] - ' + element_identifier + ' identifier requires init(visual_automation = True)') |
1098 | 1091 | return False |
1099 | 1092 |
|
1100 | 1093 | if option_value.lower().endswith('.png') or option_value.lower().endswith('.bmp'): |
1101 | | - if not os.path.isfile(option_value): |
1102 | | - print('[RPA][ERROR] - missing image file ' + option_value) |
1103 | | - return False |
1104 | | - elif not _visual(): |
| 1094 | + if not _visual(): |
1105 | 1095 | print('[RPA][ERROR] - ' + option_value + ' identifier requires init(visual_automation = True)') |
1106 | 1096 | return False |
1107 | 1097 |
|
@@ -1551,12 +1541,9 @@ def present(element_identifier = None): |
1551 | 1541 | print('[RPA][ERROR] - page.png / page.bmp requires init(visual_automation = True)') |
1552 | 1542 | return False |
1553 | 1543 |
|
1554 | | - # check for existence of specified image file for visual automation |
| 1544 | + # pre-emptive checks if image files are specified for visual automation |
1555 | 1545 | if element_identifier.lower().endswith('.png') or element_identifier.lower().endswith('.bmp'): |
1556 | | - if not os.path.isfile(element_identifier): |
1557 | | - print('[RPA][ERROR] - missing image file ' + element_identifier) |
1558 | | - return False |
1559 | | - elif not _visual(): |
| 1546 | + if not _visual(): |
1560 | 1547 | print('[RPA][ERROR] - ' + element_identifier + ' identifier requires init(visual_automation = True)') |
1561 | 1548 | return False |
1562 | 1549 |
|
|
0 commit comments