0
votes

I just setup Robot Framework yesterday. I went to youtube to see some videos on how to set up and I found one that was just uploaded last month. I follow all the steps and I numbered it below.

  1. Installed Python 2.27 and added it on Environmental Variables
  2. Installed RobotFramework (3.0.2) using pip install robotframework (CMD run as Administrator)
  3. Installed Selenium 2 Library using pip install robotframework-selenium2library
  4. Downloaded the browser drivers (chromeDriver, GeckoDriver and IE Driver) and added on Environmental Variables
  5. Downloaded the RobotFramework Database-Libary ZIP here -> http://franz-see.github.io/Robotframework-Database-Library/, then extracted the downloaded zip file
  6. In CMD, I entered python setup.py install (SUCCESS)
  7. Next, I installed the database APIs through pip install py mssql (SUCCESS)
  8. Then, I downloaded PyCharm Community 2016.3
  9. Installed IntelliBot plugin on PyCharm

I have created a project FirstProject. Under it I created a directory testsuite. In testsuite, I crearted my testcase1.robot and copy pasted some sample robot framework test on the editor and run it using command pybot testcase1.robot

However, I encountered an error saying:

[ERROR] Parsing 'testcase1.robot' failed: Data source does not exist.

Here's my code. It'll simply open Facebook through Chrome browser


*** Settings ***

Documentation  This is my first robot framework test script

Library Selenium2Library

*** Variables ***


*** Test Cases ***

open browser  http://www.facebook.com  chrome
close browser

*** Keywords ***

Regardless of my code, did I miss something on my configuration? If not, what's wrong with the code? If fixed, will that make my test run? Any feedback is well appreciated. Thank you!

3
Your indentation is all over the place. Some are three spaces, some are two. And your Selenium2Library call is only one, making it invalid. Also You have no test case. As Kootstra has shown, you need a Hello World Test Case header before you can call any keywords within it. I advice you read the documentation before doing any more tests to make sure you understand Robot better. robotframework.org/robotframework/latest/… - Goralight

3 Answers

0
votes

From the description I can't assess if your installation is correct or not. For now I'm assuming it is, and it's just your code that causes you some issues. When using a library, it has to be initialised. For every library there is good documentation available, for Selenium2Library it can be found here

The below example is the smallest browser example:

*** Settings ***
Library    Selenium2Library

*** Test Cases ***
Hello World Test Case
    open browser  http://www.facebook.com  chrome
    close browser
0
votes

"Data source does not exist" simply means you've given it the path to a file that doesn't exist. It has nothing to do with the installation, and nothing to do with the contents of your robot files.

You can replicate this quite easily:

$ robot /this/file/does/not/exist
[ ERROR ] Parsing '/this/file/does/not/exist' failed: Data source does not exist.

Try --help for usage information.
0
votes

I agree with Bryan, it has something to do with your path to a file.

Make sure to go the

file name >right click > choose "Copy Relative Path" then copypaste to the terminal.

If this doesn't work, please do investigate more on your file path.