1

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 ?

1

1 Answer 1

3

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

Sign up to request clarification or add additional context in comments.

3 Comments

Thanks @Corey . the attached document says to run on command line and i need to know the settings in Pycharm .I created the .Robot file in pycharm and Now i tried In Pycharm --> tools-->External tools--> set the 'program' as 'C:\Python37-32\Scripts\pybot.bat' and still the same issue .
you need to pass your .robot script as an argument to pybot.
Hi @Corey , Thanks much . I passed the script as an argument in External tools , and in Run/Debug configuration selected Script path as 'C:\Python37-32\Lib\site-packages\robot\run.py ' . It works fine now .

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.