0

I try to use this method

def my_click(self, locator, info="click on button error", timeout=5):
    element = self.wait_for_visibility(locator, info, timeout)
    element.click()

def wait_for_visibility(self, locator, info="no error", timeout=10):
    return WebDriverWait(self.get_driver(), timeout).until(
        expected_conditions.visibility_of_element_located(locator), info)

inside robot framework file

Register Proper Data
    [Setup]    Open Browser ${web-page}    browser=${browser}
    my click  (By.PARTIAL_LINK_TEXT, "register")

but the program returns:

TypeError: find_element() takes at most 3 arguments (35 given) - which is the number of letters in the argument

Why is it happening? How to pass arguments to a keyword?

1 Answer 1

2

Why my click argument is in brackets? It should be without brackets and comma. Something like:

my click    By.PARTIAL_LINK_TEXT    register

Please ensure that there are 3-4 spaces between the function and the variables and each variable.

Sign up to request clarification or add additional context in comments.

2 Comments

still the same error, I was using this function with python+selenium and it was working this way, maybe something else should be added to make it recognize the whole argument?
Jędrek, please check answer updated by A.Kootstra. Also try to call your keyword from RIDE. It will eliminate wrong amount of spaces/tabs.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.