# Using DataDriver

**URL:** https://forum.robotframework.org/t/using-datadriver/946
**Category:** Development
**Created:** [9 November 2020 16:34 UTC](https://forum.robotframework.org/t/using-datadriver/946 "2020-11-09T16:34:05Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![natK](https://avatars.discourse-cdn.com/v4/letter/n/46a35a/32.png) [@natK](https://forum.robotframework.org/u/natK)
#### Post date: [9 November 2020 16:34 UTC](https://forum.robotframework.org/t/using-datadriver/946/1 "2020-11-09T16:34:05Z")

</div>

Existing script design in \*\*\* Test Case \*\*\*  
I need add changes to read data from excel file and then run execution for each row.  
DataDriver design to run scripts from \*\*\* Keywords \*\*\*.  
I try ad next: call from Test2.robot to Test1.log to read excel data -\> collect all 10 arguments in Test1.log into list variables add pass it to existing file (Test2.robot)… execution is failed.  
Error: Setting ‘Test Template’ is not allowed in resource file.  
Is it possible to implement in this way or i need to modify existing script?  
Is it possible to do next: read excel in Tes1.robot and run execution to Test2.robot after each line using [Tag] name on Tes2.robot?  
I try to read loop, but Collection library from Robot Framework is not found. Do i need to install it separately?

Test1.robot

```python
***Settings***
Documentation This is the script for Create Sales Visit Repository
Library SeleniumLibrary
Library DataDriver file=1.xlsx sheet_name=Sheet1
Test Template Run Data Driven Steps

***Test Case***

***Keywords***
Run Data Driven Steps
    [Arguments] ${Arg1} ${Arg2} ${Arg3} ${Arg4} ${Arg5} ${Arg6} ${Arg7} ${Arg8} ${Arg9} ${Arg10}  
    @{ListExcelData} Create List ${Arg1} ${Arg2} ${Arg3} ${Arg4} ${Arg5} ${Arg6} ${Arg7} ${Arg8} ${Arg9} ${Arg10}  
	[Return] @{ListExcelData}

```

Test2.robot

```python
***Settings***
Library SeleniumLibrary
Resource Test1.robot

***Test Case***
 [Documentation] About the example test
 [Tags] Sanity Testing
 Run Data Driven Steps
     @{ReturnList} Run Data Driven Steps
     FOR ${i} IN RANGE @{ReturnList}         
           Log ${i}
		   
  --- use received arguments to run script

  -- call back to Test1.log to get next excel line information

 Close all browser

```

---

<div class="post-metadata">

### Author: ![René](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/ren%C3%A9/32/7_2.png) [@René](https://forum.robotframework.org/u/Ren%C3%A9)
#### Post date: [9 November 2020 16:47 UTC](https://forum.robotframework.org/t/using-datadriver/946/2 "2020-11-09T16:47:14Z")

</div>

Why are you not just call all steps you want to call in that keyword?

```python
Run Data Driven Steps
    [Arguments] ${Arg1} ${Arg2} ${Arg3} ${Arg4} ${Arg5} ${Arg6} ${Arg7} ${Arg8} ${Arg9} ${Arg10}  
    FOR ${arg} IN ${Arg1} ${Arg2} ${Arg3} ${Arg4} ${Arg5} ${Arg6} ${Arg7} ${Arg8} ${Arg9} ${Arg10}  
       #Do what ever you want to do with ${arg}
    END
```

---

<div class="post-metadata">

### Author: ![natK](https://avatars.discourse-cdn.com/v4/letter/n/46a35a/32.png) [@natK](https://forum.robotframework.org/u/natK)
#### Post date: [16 November 2020 01:18 UTC](https://forum.robotframework.org/t/using-datadriver/946/3 "2020-11-16T01:18:34Z")

</div>

I ty to avoid changes and path list to Test2.robot where adapt it to existing code … looks i have to do it anyway … Thank you
