Forum Discussion

ucuber's avatar
ucuber
Occasional Contributor
7 years ago

How to call methods of user defined objects in keyword test?

Hi *,   maybe this was asked before, but I can't find a solution.   Given:    - language: python - class definition:   remark: I prefer identifying page elements with css-selectors be...
  • tristaanogre's avatar
    7 years ago

    Short answer: you can't.  Keyword tests do not have access to the objects declared in script code without having some sort of instance or wrapper around it.  You can call a Script Routine from a keyword test but the class you have created is not available to the keyword test engine.  Your best solution is to create a wrapper function around that class so that you can call it from the keyword test.