TRoper
(Steve McGuffin)
12 June 2020 20:09
1
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
René
(René)
12 June 2020 23:50
2
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!
René
(René)
12 June 2020 23:58
3
I was thinking: “what is he watching? ”
Now i had a look to that video.
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.
René
(René)
13 June 2020 00:08
4
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.
René
(René)
13 June 2020 00:20
5
And i saw he has warning there because of duplicate test name.
This can be changed by defining the test case name.
|
|
===================================================
robotframework-datadriver
===================================================
DataDriver is a Data-Driven Testing library for Robot Framework.
This document explains how to use the DataDriver library listener. For
information about installation, support, and more, please visit the
`project page <https://github.com/Snooz82/robotframework-datadriver>`_
For more information about Robot Framework, see http://robotframework.org.
DataDriver is used/imported as Library but does not provide keywords
which can be used in a test. DataDriver uses the Listener Interface
Version 3 to manipulate the test cases and creates new test cases based
on a Data-File that contains the data for Data-Driven Testing. These
data file may be .csv , .xls or .xlsx files.
This file has been truncated. show original
TRoper
(Steve McGuffin)
15 June 2020 19:17
6
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)
vvkrnk
(vivek)
19 August 2021 21:10
8
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
vvkrnk
(vivek)
20 August 2021 09:00
9
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