# DataDriver powered test returns "Test cannot be empty" error

**URL:** <https://forum.robotframework.org/t/datadriver-powered-test-returns-test-cannot-be-empty-error/7005>\
**Category:** DataDriver\
**Created:** [15 March 2024 08:37 UTC](https://forum.robotframework.org/t/datadriver-powered-test-returns-test-cannot-be-empty-error/7005 "2024-03-15T08:37:07Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![PavelK](https://avatars.discourse-cdn.com/v4/letter/p/bbe5ce/32.png) [@PavelK](https://forum.robotframework.org/u/PavelK)\
**Post date:** [15 March 2024 08:37 UTC](https://forum.robotframework.org/t/datadriver-powered-test-returns-test-cannot-be-empty-error/7005/1 "2024-03-15T08:37:07Z")

</div>

Hi folks,

I’m trying to implement a simple test, powered by DataDriver. Just to open the browser and load url, defined in csv file. DataDriver seems to be installed, the file is read, but test returns “ **Test cannot be empty** ” error and it looks as if the ${url} and ${browserName} vars are not read/filled from the csv file? Any idea what could be wrong? Here is a screenshot, where you can see the structure of test, csv file and the errors I’m getting…

 ![image](https://europe1.discourse-cdn.com/flex005/uploads/robotframework1/original/2X/8/8c34c40ed18fb08384696a727fc8dee720c44cb3.png)

Thanks for any hint or suggestion.

---

<div class="post-metadata">

**Author:** ![damies13](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/damies13/32/623_2.png) [@damies13](https://forum.robotframework.org/u/damies13)\
**Post date:** [15 March 2024 11:11 UTC](https://forum.robotframework.org/t/datadriver-powered-test-returns-test-cannot-be-empty-error/7005/2 "2024-03-15T11:11:02Z")

</div>

Hi Pavel,

Looking at [Structure of Test Suite](https://github.com/Snooz82/robotframework-datadriver?tab=readme-ov-file#structure-of-test-suite) and [DataDriven Tests](https://docs.robotframework.org/docs/testcase_styles/datadriven), it looks like you should change this line

```python
Login with browser ${url} ${browserName}

```

to something like this, i.e. use default values for the keyword arguments rather than the variable names

```python
Login with browser http://no.set NoBrowser

```

I believe the values you put here don’t matter they don’t get used, there get replaced by the values from the CSV, but they might get used as default values if there is no value for that variable in the csv file (doesn’t apply in your case)

Apart from this it looks like you did everything else the same as the documentation 👍

Dave.

---

<div class="post-metadata">

**Author:** ![PavelK](https://avatars.discourse-cdn.com/v4/letter/p/bbe5ce/32.png) [@PavelK](https://forum.robotframework.org/u/PavelK)\
**Post date:** [15 March 2024 12:01 UTC](https://forum.robotframework.org/t/datadriver-powered-test-returns-test-cannot-be-empty-error/7005/3 "2024-03-15T12:01:13Z")

</div>

Hi Dave,

Thank you for the reply and suggestion. I tried that too but no change. It still complains about empty test?..

 ![image](https://europe1.discourse-cdn.com/flex005/uploads/robotframework1/original/2X/e/e616f62f4b4b72c1441a152c1c4ccaf00050ea8b.png)

---

<div class="post-metadata">

**Author:** ![damies13](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/damies13/32/623_2.png) [@damies13](https://forum.robotframework.org/u/damies13)\
**Post date:** [15 March 2024 14:46 UTC](https://forum.robotframework.org/t/datadriver-powered-test-returns-test-cannot-be-empty-error/7005/4 "2024-03-15T14:46:05Z")

</div>

Hi Pavel,

Is there a line 15 to OpenBrowser.robot? try adding an empty line to the end of that file.

Dave.

---

<div class="post-metadata">

**Author:** ![CharlieScene](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/charliescene/32/3484_2.png) [@CharlieScene](https://forum.robotframework.org/u/CharlieScene)\
**Post date:** [15 March 2024 19:46 UTC](https://forum.robotframework.org/t/datadriver-powered-test-returns-test-cannot-be-empty-error/7005/5 "2024-03-15T19:46:28Z")

</div>

Hi,

Seems really strange regarding the content and that all seems set properly (template, csv…)  
Only difference I see with the examples is that your test doesn’t rely on a suite/test setup to open the browser, the template contains it.

As the Datadriver built itself cases based on the first csv column, maybe there’s a conflict with the \*\*\* Test cases \*\*\* first “Login with browser” line and arguments, as the error states “Unassigned required variable”. Maybe it tries to use this line and replace url.

Seems an odd proposition, but can you try removing the line in this section or comment it (empty Test cases section), and run the test?

Regards

Charlie

---

<div class="post-metadata">

**Author:** ![PavelK](https://avatars.discourse-cdn.com/v4/letter/p/bbe5ce/32.png) [@PavelK](https://forum.robotframework.org/u/PavelK)\
**Post date:** [15 March 2024 20:55 UTC](https://forum.robotframework.org/t/datadriver-powered-test-returns-test-cannot-be-empty-error/7005/6 "2024-03-15T20:55:24Z")

</div>

Hi Dave and Charlie,

Thank you both for your suggestions. I will try them first thing Monday morning 😉 I personally think there is something wrong with the DataDriver or RoboCode integration into VSCode. I will also try the RF & DataDriver integration into PyCharm IDE. Just in case.

---

<div class="post-metadata">

**Author:** ![CharlieScene](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/charliescene/32/3484_2.png) [@CharlieScene](https://forum.robotframework.org/u/CharlieScene)\
**Post date:** [16 March 2024 17:58 UTC](https://forum.robotframework.org/t/datadriver-powered-test-returns-test-cannot-be-empty-error/7005/7 "2024-03-16T17:58:05Z")

</div>

Hi Guys,

Well well… I’ve been seeking a little bit, as it seemed really odd to me.

I reproduced your setup and indeed had the same problem.

@damies13, the added line didn’t help, not much as my own idea that led to not be able to run the test from the .robot file 😅 don’t know what was I thinking…

Tried to run from the suite, modified Test Cases arguments to _Default_, _UserData_ has in their examples.

None worked, and I finally remembered the example .csv files they gave, so here’s a working one :

 ![2024-03-16_18h36_02](https://europe1.discourse-cdn.com/flex005/uploads/robotframework1/original/2X/3/3bdb0a7847568368c6c05e599b79a3bc02f23a3b.png)

No need to play spot the difference, the twist is .csv file is separated with semicolon “;” instead of comma as in your file.

Default behavior seems to be to use the semicolon, but hopefully you don’t have to search-replace tons of .csv, and just add the dialect modifier and delimiter in the library call :

```
Library DataDriver file=parameters.csv dialect=UserDefined delimiter=,

```

More infos in this part :

> **[GitHub - Snooz82/robotframework-datadriver: Library to provide Data-Driven...](https://github.com/Snooz82/robotframework-datadriver?tab=readme-ov-file#example-user-defined)**
>
> Library to provide Data-Driven testing with CSV tables to Robot Framework - Snooz82/robotframework-datadriver

Regards.  
Charlie

---

<div class="post-metadata">

**Author:** ![PavelK](https://avatars.discourse-cdn.com/v4/letter/p/bbe5ce/32.png) [@PavelK](https://forum.robotframework.org/u/PavelK)\
**Post date:** [16 March 2024 18:12 UTC](https://forum.robotframework.org/t/datadriver-powered-test-returns-test-cannot-be-empty-error/7005/8 "2024-03-16T18:12:11Z")

</div>

Oh great find! Thank you for your investigation! I saw in one example, that someone was using semicolon, instead of comma as a separator. But I did not consider it critical. And why would I? Not to mention CSV stands for comma-separated values 😁 Once again, thank you for your help!

---

<div class="post-metadata">

**Author:** ![damies13](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/damies13/32/623_2.png) [@damies13](https://forum.robotframework.org/u/damies13)\
**Post date:** [17 March 2024 00:20 UTC](https://forum.robotframework.org/t/datadriver-powered-test-returns-test-cannot-be-empty-error/7005/9 "2024-03-17T00:20:48Z")

</div>

Well done Charlie (@CharlieScene) 👍 👍 👍

That was not obvious at all. I too would have expected the delimiter to default to comma with a file extension csv.

Dave.

---

<div class="post-metadata">

**Author:** ![HelioGuilherme66](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/helioguilherme66/32/34_2.png) [@HelioGuilherme66](https://forum.robotframework.org/u/HelioGuilherme66)\
**Post date:** [17 March 2024 16:21 UTC](https://forum.robotframework.org/t/datadriver-powered-test-returns-test-cannot-be-empty-error/7005/10 "2024-03-17T16:21:31Z")

</div>

Just a curiosity about commas versus semi-columns separators.  
In many countries, not influenced by the British Empire, we use a comma as a decimal separator (not the dot), and we actually use the comma as the thousands separator. Of course, we prefer to use the semi-column in CSV files. 🙂

I “think” ™ that the only “old” European country that uses dot as decimal separator, is The Netherlands.

---

<div class="post-metadata">

**Author:** ![damies13](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/damies13/32/623_2.png) [@damies13](https://forum.robotframework.org/u/damies13)\
**Post date:** [18 March 2024 02:22 UTC](https://forum.robotframework.org/t/datadriver-powered-test-returns-test-cannot-be-empty-error/7005/11 "2024-03-18T02:22:40Z")

</div>

Actually most countries influenced by the British Empire used commas for a thousand delimiter.

[rfc4180](https://datatracker.ietf.org/doc/html/rfc4180) caters for this with:

> Fields containing line breaks (CRLF), double quotes, and commas should be enclosed in double-quotes.

Since the .csv file extension is a defined standard for comma separated values format (CSV), the default behaviour should be to delimit on commas, but still retain the ability to specify a different delimiter as it seems to be a [common practice](https://en.wikipedia.org/wiki/Comma-separated_values#Specification) to use non-standard delimiters in csv files.

My personal preference is to use [tab separated values](https://en.wikipedia.org/wiki/Tab-separated_values), because it’s easier to paste the data in to / out of a spreadsheet, and makes it easier to generate a large data sheet of generated values (for performance testing of course), but I always name these files with .tsv (to make it clear what they are)

So if you are using semi-columns separators, should the file extension should be .ssv?

But if you really want to avoid quoted strings you could always use [HL7 V2](https://en.wikipedia.org/wiki/Health_Level_7#Version_2_messaging) (pipe delimiters) …waits for the screams from the robot framework maintainers 🤣

I guess that’s why people prefer to use JSON and YAML now days.

Dave.

---

<div class="post-metadata">

**Author:** ![PavelK](https://avatars.discourse-cdn.com/v4/letter/p/bbe5ce/32.png) [@PavelK](https://forum.robotframework.org/u/PavelK)\
**Post date:** [18 March 2024 07:51 UTC](https://forum.robotframework.org/t/datadriver-powered-test-returns-test-cannot-be-empty-error/7005/12 "2024-03-18T07:51:36Z")

</div>

Hi guys,

Believe or not, there actually is an information about semicolon in the DataDriver user guide…

 ![image](https://europe1.discourse-cdn.com/flex005/uploads/robotframework1/original/2X/f/f812f3650dfdd16ebbdefc8056f2ffc49576edb7.png)  
I’ve read the user guide several times, but apparently I missed this little detail. Not to mention that almost all DataDriver examples I found, used comma separated values 😄

I’m using US regional settings and I’ve never ever noticed semicolons in any of the CSVs I ever used. I definitely think that DataDriver should use comma as default.

Anyway, thank you both for your help and especially Charlie, who found the solution 😄
