Problem with Robot Framework and Excel

Hi,

I have installed Robotframework, PyCharm, Intellibot, Selenium using PIP3 on a MAC. No problems.
Then I installed robotframework-datadriver both through PyCharm and with PIP3.

In a test script i have included the necessary files in Settings using:

    library  datadriver  TestData/TestData.xlsx  sheet_name=Sheet1

Then when I run the test, I get an error "Importing test library ‘datadriver’ failed: ModuleNotFoundError: No module named ‘datadriver’

Any ideas what I am doing wrong?

I am following Software Testing Mentor " Robot Framework Tutorial #42 - How to do Data Driven Testing using Excel File" on youtube.

Thanks

Hi Steve,

Welcome to the forum!

You did wrote
library datadriver
But Library import is always case sensitive in RobotFramework

You have to write
Library DataDriver

And by the way:
If you use the first sheet, you do not have to name it anyway. It just picks the first sheet.

Have fun!

I was thinking: “what is he watching? :flushed:
Now i had a look to that video. :joy:
Hey that is somehow weird that someone makes a tutorial on Youtube about a library i wrote…

I did also do a talk at RoboCon 2020 about DataDriver.

It is more about the background and does not slowly explain each step, but maybe it is interesting.

By the way, when you just followed the tutorial, you habe to add Excel support as well.
It is not longer included.

Just execute
pip install --upgrade robotframework-datadriver[XLS]
In your Terminal.

And i saw he has warning there because of duplicate test name.
This can be changed by defining the test case name.

Rene,

Thank you very much for the responses to my problem. I am trying very hard to get Robot Framework to work.

The link you provided does not work.

Thank You

Steve McGuffin (TRoper)

Screen Shot 2020-06-15 at 7.10.35 AM.png

Hi Rene
Library DataDriver file=../resources/data/testData/ExAnteTestData.xlsx

I am specifying my excel path but still it is considering .csv in the same directory with the file name (as if no filename was specified)

Did pip install --upgrade robotframework-datadriver[XLS]
got version 1.4.1 using python 3.7

Hi, I identified the reason - I was using Library DataDriver in the resource file which was imported in my test file. I just had to remove this line from .recource file and it worked!

How to write into excel file using datadriver library

DataDriver is not designed to write to Excel. You’ll have to use another library for that.

1 Like