Skip to content

Run Keyword without logging as new Keyword #3640

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Snooz82 opened this issue Aug 24, 2020 · 6 comments
Open

Run Keyword without logging as new Keyword #3640

Snooz82 opened this issue Aug 24, 2020 · 6 comments
Milestone

Comments

@Snooz82
Copy link
Member

Snooz82 commented Aug 24, 2020

Run Keyword is a super handy and nice solution to execute keyword that are not part of the current library.

Example: Run a Keyword in failure like in SeleniumLibrary or Browser, or own WUKS implementation.

The only downside is, that it is not possible to NOT getting the called keyword as new Keyword-Layer in docs.

The feature requested is, that there could be way to disable Keyword beeing put to logs, when called by Run Keyword.
Logging (INFO and DEBUG, etc) should just be in the context of the calling keyword.

For me it would be good enough if there would be a python way to do it. I wouldn't need this option within Robot code.

Cheers
René

@sebastianciupinski
Copy link

@Snooz82 - I would also appreciate such option!

@pekkaklarck
Copy link
Member

Could you clarify the need in a bit more detail? Run Keyword doesn't do much logging on INFO or DEBUG level even now.

@sebastianciupinski
Copy link

sebastianciupinski commented Aug 27, 2020

@pekkaklarck I am not sure if this is the case, but code like this:

from robot.libraries.BuiltIn import BuiltIn

class example:
    def custom_kw(self, a, b):
        BuiltIn().run_keyword("Should Be Equal", a, b)
*** Settings ***
Library    example.py


*** Test Cases ***
A
    Custom Kw   9    9

Produces Log like this (where should be equal is child of custom kw)

image

@Snooz82
Copy link
Member Author

Snooz82 commented Apr 7, 2021

Yes exactly.

I had this issue several times.
I would propose to have some kind of possibility to "mute" the logger.
I know that there are monkey patching possibilities but this is ugly and robot should support this directly.

@peerasut
Copy link

peerasut commented Apr 28, 2022

run_keyword

I've got the same result when using Run Keyword. However, I don't really understand why don't you just use like this instead.

from robot.libraries.BuiltIn import BuiltIn

class example:
    def custom_kw(self, a, b):
        BuiltIn().should_be_equal(a, b)

This way it omits the log as you proposed.

@pekkaklarck
Copy link
Member

I don't think changing BuiltIn.run_keyword is a good idea, but we can consider better APIs that library keywords can use to run other keywords. There are already some related issues in RF 8 scope and I add this there as well.

@pekkaklarck pekkaklarck added this to the v8.0 milestone May 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants