# Pabotlib Run Only Once not working with Datadriver

**URL:** <https://forum.robotframework.org/t/pabotlib-run-only-once-not-working-with-datadriver/3875>\
**Category:** Pabot\
**Created:** [25 May 2022 08:12 UTC](https://forum.robotframework.org/t/pabotlib-run-only-once-not-working-with-datadriver/3875 "2022-05-25T08:12:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![HaritYadav](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/harityadav/32/1447_2.png) [@HaritYadav](https://forum.robotframework.org/u/HaritYadav)\
**Post date:** [25 May 2022 08:12 UTC](https://forum.robotframework.org/t/pabotlib-run-only-once-not-working-with-datadriver/3875/1 "2022-05-25T08:12:24Z")

</div>

I need to create the test case file for datadriver dynamically. For that I am using the config\_keyword with datadriver and using Run Only Once to make sure the file is updated only once. I then use pabot to run the tests.

The issue is the keyword after Run Only Once (below, Generate Data For Routing) is executed with every parallel run by pabot.

My code:

> ```
> Library pabot.PabotLib
> 
> Library RPA.Dialogs
> 
> Library DataDriver dialect=excel encoding=UTF-8  
> 
> ... optimize_pabot=Binary config_keyword=Startup
> 
> Test Template Route INC
> 
> # Suite Setup Run Setup Only Once Generate Data For Routing
> 
> Test Setup Open SNOW
> 
> Test Teardown End Test
> 
> Suite Teardown Shutdown
> 
> Test Timeout 5 minutes
> 
> ***Test Case***
> 
> Route INC NA NA NA NA NA
> 
>     
> 
> ***Keywords***
> 
> Startup
> 
> [Arguments] ${arguments}
> 
> **Run Only Once Generate Data For Routing**
> 
> Wait Until Created resources/E2E_Test_Cases.xlsx 60
> 
> ${new_config} = Create Dictionary file=resources/E2E_Test_Cases.xlsx sheet_name=INC # set file attribute in a dictionary
> 
> [Return] ${new_config}
> 
> End Test
> 
> Run Keyword If Test Failed Capture Page Screenshot ${SCREENSHOT_DIRECTORY}/${TASK}.png
> 
> Close Browser
> 
> Shutdown
> 
> Run Keyword And Ignore Error Close All Browsers
> 
> Generate Data For Routing
> 
> Log Generate Date file
> 
> Open SITE
> 
> Get Active Tasks
> 
> Generate Routing Map
> 
>         
> 
> Route INC
> 
> [Arguments] ...
> 
> ```

Command to run in a bat file:

> pabot --testlevelsplit --pabotlib --rpa --variable PROD\_DEV:%RunType% -d results%runIndex% --name AIR\_%runIndex% --log trace.aspx --report report.aspx --loglevel TRACE --splitlog Air.robot

---

<div class="post-metadata">

**Author:** ![HaritYadav](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/harityadav/32/1447_2.png) [@HaritYadav](https://forum.robotframework.org/u/HaritYadav)\
**Post date:** [26 May 2022 04:49 UTC](https://forum.robotframework.org/t/pabotlib-run-only-once-not-working-with-datadriver/3875/2 "2022-05-26T04:49:41Z")

</div>

After some testing we found that pabot 2.5.3 and data driver 1.6.1 give this issue  
But it is not there when using pabot 2.5.1 and data driver 1.6.0.
