Index: shared/scripts/configuration/utility.py =================================================================== diff -u -rad127573cddcce09dae08411236fa063a736979c -r4dfe8f7ce0cf625ca3039ff482eba432f3cf7ade --- shared/scripts/configuration/utility.py (.../utility.py) (revision ad127573cddcce09dae08411236fa063a736979c) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision 4dfe8f7ce0cf625ca3039ff482eba432f3cf7ade) @@ -11,6 +11,7 @@ # @date (last) 15-Jan-2022 # ############################################################################ + import builtins import csv import glob @@ -1167,7 +1168,7 @@ squish.mouseClick(key_val) utils.waitForGUI(0.1) test.endSection() - + def get_extracted_alarm_mapping_file(): """ This function is the handler for getting error file from service folder. @@ -1250,9 +1251,39 @@ shutil.rmtree(path+filename) test.log(str(files+"_1 name changed to "+filename)) utils.waitForGUI(5) - if files != filename: + + if files != filename: + if (files == filename+"_1"): os.rename(path+files,path+filename) test.log(str(files+" name changed to "+filename)) +def scroll_to_zone(zone=None, screen_object=None, direction = None): + """ + scroll to the to the value if object is hidden + @param value - (obj) value object + @param container - (obj) Container of the value + @return boolean true and false + """ + counter = 0 + while counter <= 100: + try: + counter += 1 + squish.findObject(zone) + squish.snooze(0.5) + if check_if_object_is_within_the_container(obj=zone, container=screen_object): + return True + else: + raise RuntimeError + except RuntimeError: + ScreenObj = squish.findObject(screen_object) + screenHeight = pyInt(ScreenObj.height) + screenWidth = pyInt(ScreenObj.width) + if direction is None: + squish.mouseWheel(ScreenObj, (screenWidth-100), 107, 0, -(screenHeight-460), squish.Qt.NoModifier) + else: + squish.mouseWheel(ScreenObj, (screenWidth-100), -(screenHeight-700), 0, 200, squish.Qt.NoModifier) + + raise LookupError("zone object is not in view to the user after trying 100 times") +