Use python script in robot framework
<p>Please help to understand.</p>

<p>I have script (SplitModule.py) :</p>

<pre><code>from robot.api.deco import keyword

@keyword('Split Function')
def splitfunction(string):
    print "atata"
    new_list = string.split(",")
    return new_list
</code></pre>

<p>And robot framework script test.txt :</p>

<pre><code>*** Settings ***
Library           DiffLibrary
Library           String
Library           OperatingSystem
Library           Collections
Library       SplitModule.py

*** Test Cases ***
Example of calling a python keyword that calls a robot keyword
    Split Function ${services}
</code></pre>

<p>But I have a problem with function, there is out :</p>

<blockquote>
  <p>============================================================================== Robot
  ============================================================================== Robot.Check Services
  ============================================================================== Example of calling a python keyword that calls a robot keyword<br>
  | FAIL | No keyword with name 'Split Function ${services}' found.
  ------------------------------------------------------------------------------ Robot.Check Services<br>
  | FAIL | 1 critical test, 0 passed, 1 failed 1 test total, 0 passed, 1
  failed
  ============================================================================== Robot<br>
  | FAIL | 1 critical test, 0 passed, 1 failed 1 test total, 0 passed, 1
  failed
  ============================================================================== Output:  /opt/robot/logs/output.xml Log:     /opt/robot/logs/log.html
  Report:  /opt/robot/logs/report.html</p>
</blockquote>

<p>What's the problem? thanks</p>

<p>Read what the error message is telling you:</p>

<blockquote>
  <p>No keyword with name 'Split Function ${services}' found. </p>
</blockquote>

<p>It thinks the test is trying to call the keyword <code>Split Function ${services}</code>. You don't have a keyword with that name. What you <em>do</em> have is a keyword named <code>Split Function</code> which takes an argument. Therefore, you need to use the proper syntax for passing the argument to the keyword. </p>

<p>In other words, you need two or more spaces between the keyword and the argument:</p>

<pre><code>Split Function  ${services}  # need at least two spaces before $
</code></pre>

python robotframework