# How do we run start\_suite (listener function) only once for all tests using pabot?

**URL:** https://forum.robotframework.org/t/how-do-we-run-start-suite-listener-function-only-once-for-all-tests-using-pabot/7885
**Category:** Pabot
**Created:** [6 October 2024 12:24 UTC](https://forum.robotframework.org/t/how-do-we-run-start-suite-listener-function-only-once-for-all-tests-using-pabot/7885 "2024-10-06T12:24:28Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![yadubhushan](https://avatars.discourse-cdn.com/v4/letter/y/7ea924/32.png) [@yadubhushan](https://forum.robotframework.org/u/yadubhushan)
#### Post date: [6 October 2024 12:24 UTC](https://forum.robotframework.org/t/how-do-we-run-start-suite-listener-function-only-once-for-all-tests-using-pabot/7885/1 "2024-10-06T12:24:28Z")

</div>

Looks like the start\_suite function runs before every test case in robot file when we run tests in parallel using pabot witn option --splittestlevel. Could someone suggest if there is a way to make start\_suite run only once for all test cases? Below is what is happening for me now on running tests in parallel using pabot

start\_suite  
start\_test  
test a  
end\_test  
end\_suite  
start\_suite  
start\_test  
test b  
end\_test  
end\_suite

However, I have been exploring to make it work like below

start\_suite  
start\_test  
test a  
end\_test  
start\_test  
test b  
end\_test  
end\_suite

---

<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: [6 October 2024 12:30 UTC](https://forum.robotframework.org/t/how-do-we-run-start-suite-listener-function-only-once-for-all-tests-using-pabot/7885/2 "2024-10-06T12:30:07Z")

</div>

Hi Bhushan,

See `Run Setup Only Once` in [Execution affecting keywords](https://pabot.org/PabotLib.html#execution)

Dave.

---

<div class="post-metadata">

### Author: ![yadubhushan](https://avatars.discourse-cdn.com/v4/letter/y/7ea924/32.png) [@yadubhushan](https://forum.robotframework.org/u/yadubhushan)
#### Post date: [6 October 2024 12:35 UTC](https://forum.robotframework.org/t/how-do-we-run-start-suite-listener-function-only-once-for-all-tests-using-pabot/7885/3 "2024-10-06T12:35:48Z")

</div>

@damies13 Thanks for the response

I tried to do it. But could not import the pabot library in robot file. Could you suggest on how to import it? I tried below

Library. pabot/PabotLib

---

<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: [6 October 2024 13:17 UTC](https://forum.robotframework.org/t/how-do-we-run-start-suite-listener-function-only-once-for-all-tests-using-pabot/7885/4 "2024-10-06T13:17:21Z")

</div>

Hi Bhushan,

There’s additional info on the [pabot github page](https://github.com/mkorpela/pabot)

- When you run pabot, you need to use the `--pabotlib` option
- the library import is (you were close):

```python
Library pabot.PabotLib

```

Dave.

---

<div class="post-metadata">

### Author: ![yadubhushan](https://avatars.discourse-cdn.com/v4/letter/y/7ea924/32.png) [@yadubhushan](https://forum.robotframework.org/u/yadubhushan)
#### Post date: [7 October 2024 16:21 UTC](https://forum.robotframework.org/t/how-do-we-run-start-suite-listener-function-only-once-for-all-tests-using-pabot/7885/5 "2024-10-07T16:21:31Z")

</div>

@damies13 I am able to import pabot library now. There was an issue with my IDE due to which it could not recognize the library. Thanks
