You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
When library is using @keyword decorator to give new name for the keyword, then the method can not be called with the method name programmatically #2
from robotlibcore import keyword
from robotlibcore import DynamicCore
class KwClass(object):
@keyword('My Keyword')
def my_kw(self):
print 'My Kw'
class MyLibrary(DynamicCore):
def __init__(self):
DynamicCore.__init__(self, [KwClass()])
if __name__ == '__main__':
x = MyLibrary()
print x.keywords
x.my_kw()
Then I can not call keyword with the method name my_kw and the above code raises:
{'My Keyword': <bound method KwClass.my_kw of <__main__.KwClass object at 0x059728D0>>}
Traceback (most recent call last):
File "foo.py", line 21, in <module>
x.my_kw()
File "D:\workspace\SeleniumLibrary\src\SeleniumLibrary\base\robotlibcore.py", line 80, in __getattr__
.format(type(self).__name__, name))
AttributeError: 'MyLibrary' object has no attribute 'my_kw'
changed the title [-]When library is using DynamicCore and use @keyword decorator to give new name for the keyword, then the method can not be called with the method name programmatically [/-][+]When library is using @keyword decorator to give new name for the keyword, then the method can not be called with the method name programmatically [/+]on Nov 27, 2017
Activity
[-]When library is using DynamicCore and use @keyword decorator to give new name for the keyword, then the method can not be called with the method name programmatically [/-][+]When library is using @keyword decorator to give new name for the keyword, then the method can not be called with the method name programmatically [/+]