Skip to content

Conversation

@ToWhiD073
Copy link
Collaborator

@ToWhiD073 ToWhiD073 commented Feb 2, 2026

PR Type

Bug Fix

PR Checklist

  • Tests for the changes have been added / updated.
  • Documentation comments have been added / updated.
  • A changelog entry has been made.
  • Version number has been updated.
  • Required modules have been added to respective "requirements*.txt" files.
  • Relevant Test Cases added to this description (below).
  • (Team) Label with affected action categories and semver status.

Overview

Bug Description

The disable step action was not being respected inside step loop execution. When a step inside a loop disabled other steps (e.g., STEP-2 disables STEP-3 and STEP-4), those disabled steps would still execute within the loop, even though they were correctly skipped after the loop completed.

Root Cause:

  • Single list (disabled_step) was used for two purposes: user intent (disable_step action) and loop bookkeeping (prevent re-running loop-consumed steps)
  • Step loop executor had no check for disabled_step before executing steps
  • Only the outer scheduler honored the disabled_step list

Previous Behavior (Broken)

STEP-1: Loop through STEP-2 to STEP-5
  ├─ STEP-2 executes → disables STEP-3, STEP-4
  ├─ STEP-3 executes (should be skipped)
  ├─ STEP-4 executes (should be skipped)
  └─ STEP-5 executes

New Behavior (Fixed)

STEP-1: Loop through STEP-2 to STEP-5
  ├─ STEP-2 executes → disables STEP-3, STEP-4
  ├─ STEP-3 skipped ✓ (disabled by user)
  ├─ STEP-4 skipped ✓ (disabled by user)
  └─ STEP-5 executes

Changes Made

1. Framework/Utilities/CommonUtil.py

Added: New list for loop bookkeeping

disabled_step = []  
loop_consumed_step = [] 

Purpose: Separate user intent from system bookkeeping


2. Framework/Built_In_Automation/Sequential_Actions/sequential_actions.py

Changed:

# Before:
CommonUtil.disabled_step += [i+1 for i in values]

# After:
CommonUtil.loop_consumed_step += [i+1 for i in values]

Purpose: Use dedicated list for loop bookkeeping instead of mixing with user intent


3. Framework/Built_In_Automation/Sequential_Actions/sequential_actions.py

Added: Check for disabled steps before executing in loop

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

Purpose: Respect user-disabled steps during loop execution


4. Framework/MainDriverApi.py

Changed:

# Before:
if StepSeq in CommonUtil.disabled_step or not this_step['step_enable']:

# After:
if StepSeq in CommonUtil.disabled_step or StepSeq in CommonUtil.loop_consumed_step or not this_step['step_enable']:

Purpose: Check both lists when skipping steps in outer scheduler


5. Framework/MainDriverApi.py

Added: Reset loop bookkeeping list per test case

CommonUtil.disabled_step = []
CommonUtil.loop_consumed_step = []  # New line
CommonUtil.testcase_exit = ""

Purpose: Clean state for each test case execution


Test Cases

Files Changed

  1. Framework/Utilities/CommonUtil.py
  2. Framework/Built_In_Automation/Sequential_Actions/sequential_actions.py
  3. Framework/MainDriverApi.py

…de step-looped for loops now correctly exits only the current step's actions, allowing subsequent steps to execute for the same iteration. Added flag check after Run_Sequential_Actions call.
@ToWhiD073 ToWhiD073 self-assigned this Feb 2, 2026
@ToWhiD073 ToWhiD073 added the bug Something isn't working label Feb 2, 2026
@Muntasib-creator
Copy link
Collaborator

test if nested for loop break works, with the changes made.

@ToWhiD073
Copy link
Collaborator Author

test if nested for loop break works, with the changes made.

yes it is working

…le_step not working inside step loop execution.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants