Integer variable from a custom keyword in the robot framework
<p>I have a custom keyword in the robot framework which counts the items of a list. This works already in my underlying python file and prints the number 5 when five elements exists in a list.</p>

<p>Then I want to bring this value to the robot framework. But instead of a number I get:
 <code>${N_groups}</code> is <code>&lt;built-in method count of list object at 0x03B01D78&gt;</code></p>

<p>The code of the robot file:</p>

<pre><code>*** Test Cases ***
Count Groups
    ${N_groups}    Setup Groups Count Groups
    log to console    ${N_groups}
</code></pre>

<p>How to get item-count of the list as an integer value?</p>

<p>Here is a part of my python file:</p>

<pre><code>@keyword(name="Count Groups")
def count_groups(self):
    N = self.cur_page.count_groups()
    return N
</code></pre>

<p>And a more low level python file:</p>

<pre><code>        def count_groups(self):
            ele_tc = self._wait_for_treecontainer_loaded(self._ef.get_setup_groups_treecontainer())
            children_text = self._get_sublist_filter(ele_tc, lambda ele: ele.find_element_by_tag_name('a').text,
                                                     True)
            return children_text.count
</code></pre>