in my Robot framework tests I need some custom python keywords (e.g. to hold CTRL key)
And everything worked before I started refactoring my "big" custom class (but I did not really change anything in this part around hold CTRL).
Now I am getting AttributeError: 'Selenium2Library' object has no attribute 'execute'
My code is:
class CustomSeleniumLibrary(object):
def __init__(self):
self.driver = None
self.library = None
def get_webdriver_instance(self):
if self.library is None:
self.library = BuiltIn().get_library_instance('Selenium2Library')
return self.library
def get_action_chain(self):
if self.driver is None:
self.driver = self.get_webdriver_instance()
self.ac = ActionChains(self.driver)
return self.ac
def hold_ctrl(self):
self.get_action_chain().key_down(Keys.LEFT_CONTROL)
self.get_action_chain().perform()
and I just call "hold ctrl" directly in robot keyword then, the keyword file has my custom class imported as Library (and other custom keywords work)... Any idea why it fails on the "execute" please?
execute. Also, please fix your indentation.