diff --git a/Framework/Built_In_Automation/Sequential_Actions/sequential_actions.py b/Framework/Built_In_Automation/Sequential_Actions/sequential_actions.py index 7a6fcc3c..1459037d 100755 --- a/Framework/Built_In_Automation/Sequential_Actions/sequential_actions.py +++ b/Framework/Built_In_Automation/Sequential_Actions/sequential_actions.py @@ -596,7 +596,7 @@ def for_loop_action(step_data, data_set_no): values = get_data_set_nums(sr.get_previous_response_variables_in_strings(row[2].strip()), step_loop) if step_loop: loop_steps = [list(range(len(CommonUtil.all_step_dataset[i]))) if i in values else [] for i in list(range(len(CommonUtil.all_step_dataset)))] - CommonUtil.disabled_step += [i+1 for i in values] + CommonUtil.loop_consumed_step += [i+1 for i in values] else: loop_steps[step_index] += values # outer_skip += loop_this_data_sets @@ -711,6 +711,13 @@ def for_loop_action(step_data, data_set_no): sr.Set_Shared_Variables(each_varname, each_val) for step_cnt, each_step in enumerate(loop_steps): if len(each_step) == 0: continue + if (step_cnt + 1) in CommonUtil.disabled_step: + CommonUtil.ExecLog( + sModuleInfo, + "STEP-%s is disabled. Skipping execution inside step loop" % (step_cnt + 1), + 2 + ) + continue inner_skip = [] outer_skip = each_step CommonUtil.current_step_no = str(step_cnt+1) @@ -818,11 +825,9 @@ def for_loop_action(step_data, data_set_no): CommonUtil.ExecLog(sModuleInfo, "Condition matched. Continuing to next iteration", 1) cont_break = True break - if step_exit_fail_called or step_exit_pass_called: die = True break - if die or cont_break: break if die: diff --git a/Framework/MainDriverApi.py b/Framework/MainDriverApi.py index f7734a5f..54e9deec 100644 --- a/Framework/MainDriverApi.py +++ b/Framework/MainDriverApi.py @@ -599,7 +599,7 @@ def run_all_test_steps_in_a_test_case( sTestStepStartTime = datetime.fromtimestamp(TestStepStartTime, tz=pytz.UTC).strftime("%Y-%m-%d %H:%M:%S.%f") WinMemBegin = CommonUtil.PhysicalAvailableMemory() # get available memory - if StepSeq in CommonUtil.disabled_step or not this_step['step_enable']: + if StepSeq in CommonUtil.disabled_step or StepSeq in CommonUtil.loop_consumed_step or not this_step['step_enable']: CommonUtil.ExecLog(sModuleInfo, "STEP-%s is disabled" % StepSeq, 2) sStepResult = "skipped" elif CommonUtil.testcase_exit: @@ -2008,6 +2008,7 @@ def main(device_dict, all_run_id_info): } set_device_info_according_to_user_order(device_order, device_dict, test_case_no, test_case_name, user_info_object, Userid, run_id=run_id) CommonUtil.disabled_step = [] + CommonUtil.loop_consumed_step = [] CommonUtil.testcase_exit = "" # Download test case and step attachments diff --git a/Framework/Utilities/CommonUtil.py b/Framework/Utilities/CommonUtil.py index b68c3df7..2fc3bc37 100644 --- a/Framework/Utilities/CommonUtil.py +++ b/Framework/Utilities/CommonUtil.py @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- +# -*- coding: utf-8 -*- # -*- coding: cp1252 -*- import selenium @@ -147,7 +147,8 @@ jwt_token = "" run_cancel = "" run_cancelled = False -disabled_step = [] # 1 based indexing +disabled_step = [] # 1 based indexing (user requested step disable) +loop_consumed_step = [] # 1 based indexing (steps executed via step loop) testcase_exit = "" max_char = 0 compare_action_varnames = {"left":"Left", "right":"Right"} # for labelling left and right variable names of compare action