# Problem with integration of tqdm (Progress Bar ) with robotframework

**URL:** <https://forum.robotframework.org/t/problem-with-integration-of-tqdm-progress-bar-with-robotframework/4037>\
**Category:** Extensions\
**Created:** [21 June 2022 17:20 UTC](https://forum.robotframework.org/t/problem-with-integration-of-tqdm-progress-bar-with-robotframework/4037 "2022-06-21T17:20:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![IlfirinPL](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/ilfirinpl/32/1608_2.png) [@IlfirinPL](https://forum.robotframework.org/u/IlfirinPL)\
**Post date:** [21 June 2022 17:20 UTC](https://forum.robotframework.org/t/problem-with-integration-of-tqdm-progress-bar-with-robotframework/4037/1 "2022-06-21T17:20:12Z")

</div>

I have problem with integration with tqdm library ([GitHub - tqdm/tqdm: A Fast, Extensible Progress Bar for Python and CLI](https://github.com/tqdm/tqdm) ) to create nice progress bar, after executing code console won`t update  
To install lib

```
pip install tqdm

```

Python code that works

```
import time
from tqdmLibrary import tqdm
pbar = tqdm(desc="Test", total=10)
for i in range(10):
    time.sleep(0.3)
    pbar.update()
pbar.close()

```

code of library

```
from tqdm import tqdm
from robot.api.deco import library, keyword
ROBOT_LIBRARY_DOC_FORMAT = "reST"
@library(scope="GLOBAL")
class tqdmLibrary:
    def __init__ (self):
        pass
    @keyword
    def start_tqdm(self, total=None, desc=None, **kwargs):
        self.pbar = tqdm(total=int(total), desc=desc, **kwargs)

    @keyword
    def update_tqdm(self, n=1):
        self.pbar.update(int(n))

```

Robot Code

```
***Settings***
Library tqdmLibrary.py

***Test Cases***
Progres Bar
    Start Tqdm total=10 desc=Test
    FOR ${counter} IN RANGE 10
        Update Tqdm
        Sleep 0.3
    END

```

---

<div class="post-metadata">

**Author:** ![IlfirinPL](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/ilfirinpl/32/1608_2.png) [@IlfirinPL](https://forum.robotframework.org/u/IlfirinPL)\
**Post date:** [22 June 2022 06:14 UTC](https://forum.robotframework.org/t/problem-with-integration-of-tqdm-progress-bar-with-robotframework/4037/2 "2022-06-22T06:14:57Z")

</div>

small fix  
` from tqdm import tqdm`  
instead of

`from tqdmLibrary import tqdm`

---

<div class="post-metadata">

**Author:** ![rasjani](https://avatars.discourse-cdn.com/v4/letter/r/858c86/32.png) [@rasjani](https://forum.robotframework.org/u/rasjani)\
**Post date:** [22 June 2022 08:56 UTC](https://forum.robotframework.org/t/problem-with-integration-of-tqdm-progress-bar-with-robotframework/4037/3 "2022-06-22T08:56:21Z")

</div>

First off with caveat that i havent really used tqdm that much: when you call `Update Tqdm` keyword, shouldn’t you pass ${counter} to it - as it looks like you call the keyword now 10 times but always passing 1 to it?

That said, i made a “poc” type of implementation with Tkinter, very similar to your except its actual gui. Check out the code and example.robot @ [GitHub - rasjani/robotframework-guistatus: UI For showing progress of currently running tests or automation processes for Robot Framework](https://github.com/rasjani/robotframework-guistatus)

---

<div class="post-metadata">

**Author:** ![IlfirinPL](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/ilfirinpl/32/1608_2.png) [@IlfirinPL](https://forum.robotframework.org/u/IlfirinPL)\
**Post date:** [23 June 2022 12:37 UTC](https://forum.robotframework.org/t/problem-with-integration-of-tqdm-progress-bar-with-robotframework/4037/4 "2022-06-23T12:37:26Z")

</div>

Update increase “count” by default by 1 , if you can set greater values.  
I need something in cli or used on jenkins.  
I notice problem that is related with interaction with robotframework handles output and tqdm have the same goal :). So it can`t update current output (its interaction on using “CR”
