from robot.api import logger
def log_hello(self):
logger.console('hello')
def call_log_hello(self):
self.log_hello()Ugh
Have you looked at User Guide, Using builtin library [1] chapter? Also reading the extending test libraries [2] chapter is useful reading.
But I am just wondering, why you would like to call function and want the function to be treated as keyword from Robot Framework point of view? Usually, I want the exactly opposite, because I want to control the output and make log easier to read.
-Tatu
Send from my mobile
[1] http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#using-builtin-library
[2] http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#extending-existing-test-libraries
--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-u...@googlegroups.com.
To post to this group, send email to robotframe...@googlegroups.com.
Visit this group at http://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.
Ugh
Have you looked at User Guide, Using builtin library [1] chapter? Also reading the extending test libraries [2] chapter is useful reading.
But I am just wondering, why you would like to call function and want the function to be treated as keyword from Robot Framework point of view? Usually, I want the exactly opposite, because I want to control the output and make log easier to read.
-Tatu
Send from my mobile
[1] http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#using-builtin-library
[2] http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#extending-existing-test-libraries
On 3 Dec 2015 2:31 p.m., "adaronen" <ro...@adallom.com> wrote:
Hey all,--I'm using robot framework for a year now, and I'm looking for a way to make all my python functions open a new hierarchy in the output log. for example I have this code:I want that by calling the call_log_hello function from my robot script and that the log_hello function will be treated as a robot keyword and the output.log will have it's own hierarchy for the function scopefrom robot.api import logger
def log_hello(self):
logger.console('hello')
def call_log_hello(self):
self.log_hello()Thanks, Ronen
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-users+unsub...@googlegroups.com.
Ugh
Could you explain what is your requirement/need better? Perhaps there are other ways to fulfill your requirement than the way you are currently expressing.
But BuiltIn is the way to go, but as usual there is a catch. Not all functions are keywords in Robot Framework. Also if outer function calls an inner function, it is not possible (as far I know) to execute that inner function as a keyword (if that function is not a keyword already). Reading the chapter 4 [1] from user guide is will explain lot of useful points in this matter.
-Tatu
Send from my mobile
[1] http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#creating-test-libraries
--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-u...@googlegroups.com.
Ugh
I can understand that it could be a problem, but usually one wants to hide the complex logic. I also have similar structure in place and usually it's enough to perform good logging in required places. What good means is usually very difficult problem to solve. Because there should not be too much of the logging, if all goes well but there should be enough logging to indicate where the failure was and how to solve it.
But what you want, can be done, to some extend, with the BuiltIn library and run* keywords. But I would not take that road, because in my mind it would lead to poor code quality, hard to debug problems and it doesn't solve the problem completely.
-Tatu
Send from my mobile
I want to allow my team mates to be able to debug their tests flows.
We have a really long integration tests that are based on robot framework keywords for simple logic and python objects and functions for more complex logic.
The testers are used to the robot framework output log and I want to add them the ability to debug the python in the same way.