title: How to pass objects to keywords in robot framework?
body: <p>I have a python class <code>MyClass</code> written in file <code>MyClass.py</code>:</p>
  
  <pre><code>class MyClass(object):
      def __init__(self):
          self.myvar = list()
  
      def setvar(self, val):
          self.myvar = val
  
      def mymethod(self):
          return self.myvar
  </code></pre>
  
  <p>I have imported in Robot Framework as below:</p>
  
  <pre><code>Library         MyClass    WITH NAME    my_component
  </code></pre>
  
  <p>I also have a keyword which call a method of objects which are passed to it:</p>
  
  <pre><code>testing component
      [Arguments]       ${cmp}
      log to console    ************* ${cmp}
      ${result} =       ${cmp}.mymethod
  </code></pre>
  
  <p>I have multiple objects instantiated from class <code>MyClass</code> and every object has different properties. I want to get their attributes using <code>testing component</code> keyword regardless of the object itself.</p>
  
  <p>When I call <code>testing component</code> passing <code>my_component</code>: </p>
  
  <pre><code>Test Method Call
      testing component    my_component
  </code></pre>
  
  <p>I get:</p>
  
  <pre><code>No keyword with name '${cmp}.mymethod' found.
  </code></pre>
  
  <p>If I call it this way in keyword <code>testing component</code>:</p>
  
  <pre><code>${result} =    call method     ${cmp}   mymethod
  </code></pre>
  
  <p>I get:</p>
  
  <pre><code>Object 'my_component' does not have method 'mymethod'.
  </code></pre>
  
  <p>I also tried <code>call method     my_component    mymethod</code> for test and I again got <code>Object 'my_component' does not have method 'mymethod'.</code>. </p>
  
  <p>But when I use <code>${result} =     my_component.mymethod</code>, everything works fine.</p>