Я решил это.И мой код Python
from functools import wraps
from robot.libraries.BuiltIn import register_run_keyword
from robot.libraries.BuiltIn import BuiltIn
def robot_run_keyword(func):
@wraps(func)
def func_wrapper(self,*args, **kwargs):
if not hasattr(func, "second"):
setattr(func, "second", True)
ar = list(args)
for key, value in kwargs.items():
ar.append("%s=%s"%(key,value))
register_run_keyword("WiseLibrary",func.__name__,len(ar),deprecation_warning=False)
return BuiltIn().run_keyword(func.__name__, *ar)
else:
delattr(func, "second")
return func(self,*args, **kwargs)
return func_wrapper