Reputation: 11
Iam new to Robot framework . I have installed below.
Python 3.7.0
Pycharm 2018.1.4 community edition
Robot framework 3.0.4
robotframework==3.0.4
robotframework-selenium2library==3.0.0
robotframework-seleniumlibrary==3.1.1
I also set the environment variable --> path as "C:\Python37-32\Scripts;C:\Python37-32 "
In pycharm Created a new Demo.robot file . In Pycharm --> tools-->External tools--> set the 'program' as 'C:\Python37-32\Scripts\robot.bat' and 'working directory' as 'C:\Python37-32\Scripts' .
In Pycharm 'Run/debug configuration'-->'Script path' set as 'C:\Users\inmj\PycharmProjects\PycharmProject1\Demo.robot'
'Python Interpreter' as 'Python 3.7 (PycharmProject1)'
Tried running below script in Pycharm
*** Settings ***
Documentation sample
Library SeleniumLibrary
It gives me error as below
C:\Python37-32\python.exe C:/Users/inmj/PycharmProjects/PycharmProject1/Demo.robot File "C:/Users/inmj/PycharmProjects/PycharmProject1/Demo.robot", line 1
*** Settings ***
^
SyntaxError: invalid syntax
Could anyone please help me ?
Upvotes: 1
Views: 7201
Reputation: 60604
You are trying to execute a Robot script directly with a Python interpreter. Python interpreters only understand Python code, not Robot syntax.
you need to execute your Robot scripts through the robot runner. see: http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#executing-robot-framework
Upvotes: 3