Skip to content

Run Keywords: Execution is not continued in teardown if keyword name contains non-existing variable #4453

Closed

Description

@peerasut

When I have 2 keywords: the first one is embedded keyword, the second one is either embedded or normal keyword. I use these 2 keywords within [Teardown] and with using Run Keywords keyword. If the first keyword fails because it could not find embedded argument, it fails and does not continue to execute the second keyword.

For example:

*** Test Cases ***
TC teardown fail
    ${var}    Set Variable    1
    [Teardown]    Run Keywords    Embbedded Kw ${b}
    ...    AND   Log  ${var}

*** Keywords ***
Embbedded Kw ${x}
    Log    ${x}

The result: Embbedded Kw ${x} fails because arg ${b} is not found. But it does not continue to execute Log ${var}.
image

As stated in documentation that Teardown has ability to continue on failure. So, I think that in case of embedded keyword it should continue to execute event it could not find the embedded argument.
image

As I have been in this community for a while, I could implement this one if it's not too complex.

Note: I used Robot Framework 5.0.1

Activity

  1. changed the title [-]In Tearddown, using embedded keywords in Run Keywords does not continue another keyword when the first keyword fails[/-] [+]In Teardown, using embedded keywords in Run Keywords does not continue another keyword when the first keyword fails[/+] on Sep 7, 2022
  2. pekkaklarck commented on Sep 8, 2022

    @pekkaklarck
    Member

    I can reproduce the problem, but the problem isn't actually with embedded arguments but with Run Keywords. The same problem occurs if you use Run Keywords in teardown so that the keyword name is a variable. For example, here the second keyword isn't run:

    *** Test Cases ***
    Example
        No Operation
        [Teardown]    Run Keywords    ${bad}    AND    Fail 

    Embedded arguments work fine in teardowns if you use them inside a normal keyword like here:

    *** Test Cases ***
    Example
        No Operation
        [Teardown]    Keyword
    
    *** Keywords ***
    Keyword
         Embbedded Kw ${bad}
         Fail    This is run

    The problem with Run Keywords is pretty easy to fix. The fix also gives be an idea how we possibly could fix #1595 that affects embedded args when used with Run Keywords or other keywords running keywords internally.

  3. changed the title [-]In Teardown, using embedded keywords in Run Keywords does not continue another keyword when the first keyword fails[/-] [+]`Run Keywords`: Execution is not continued in teardown if keyword name contains non-existing [/+] on Sep 8, 2022
  4. added this to the v5.1 milestone on Sep 8, 2022
  5. changed the title [-]`Run Keywords`: Execution is not continued in teardown if keyword name contains non-existing [/-] [+]`Run Keywords`: Execution is not continued in teardown if keyword name contains non-existing variable[/+] on Sep 9, 2022
  6. added theissue type on Dec 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions