# Debug python DB code exception through robot framework

**URL:** <https://forum.robotframework.org/t/debug-python-db-code-exception-through-robot-framework/4961>\
**Category:** PyCharm\
**Created:** [18 November 2022 17:01 UTC](https://forum.robotframework.org/t/debug-python-db-code-exception-through-robot-framework/4961 "2022-11-18T17:01:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shneyi](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/shneyi/32/2080_2.png) [@Shneyi](https://forum.robotframework.org/u/Shneyi)\
**Post date:** [18 November 2022 17:01 UTC](https://forum.robotframework.org/t/debug-python-db-code-exception-through-robot-framework/4961/1 "2022-11-18T17:01:38Z")

</div>

Hello, I worked on robot framework recently and there is an existing project to test.

Run command line in git bash as follows (from security purpose, I could not give exact info)  
powershell .build/xxx.ps1 -{var1} val1 -{var2} val2 … -testName “Test that at Head of Line…”

I got a exception from python DB code. I wonder

1. Is it possible that I could see trace stack? for example, which python files and which lines throws exception from bottom to top,
2. how to debug this test case by Pycharm or other IDE? (some screenshoot woudl be great!)

Thanks for the help.  
Shenyi

Test that at Head of Line … (robot framwork test case)  
…  
| FAIL | (could not find any track stack info, I even don’t know which file or line throwns exception)  
DBAPIError: (pyodbc.Error) (‘HY000’, '[HY000] [DataDirect][ODBC OpenAccess SDK driver][OpenAccess SDK SQL Engine]UPDATE failed: Unable to update column XXX (python library calls DB update)

---

<div class="post-metadata">

**Author:** ![robinmackaij](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/robinmackaij/32/126_2.png) [@robinmackaij](https://forum.robotframework.org/u/robinmackaij)\
**Post date:** [20 November 2022 18:18 UTC](https://forum.robotframework.org/t/debug-python-db-code-exception-through-robot-framework/4961/2 "2022-11-20T18:18:43Z")

</div>

If you use the RF LSP plugin, you can put breakpoints in the RF or Python code and step through etc. The plugin can be found here:  
[Robot Framework Language Server - IntelliJ IDEs Plugin | Marketplace (jetbrains.com)](https://plugins.jetbrains.com/plugin/16086-robot-framework-language-server)

---

<div class="post-metadata">

**Author:** ![Shneyi](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/shneyi/32/2080_2.png) [@Shneyi](https://forum.robotframework.org/u/Shneyi)\
**Post date:** [20 November 2022 19:50 UTC](https://forum.robotframework.org/t/debug-python-db-code-exception-through-robot-framework/4961/3 "2022-11-20T19:50:42Z")

</div>

Thank you for the reply robinmackaij. I found the best IDE is vs code instead of pycharm. Here is my repo [GitHub - bobydo/robot-framework-testautomationu](https://github.com/bobydo/robot-framework-testautomationu) to show what extensions are required. some tips came from [Introduction to Robot Framework](https://testautomationu.applitools.com/robot-framework-refresh) and others came from internet research. it is sloved. thanks again!

---

<div class="post-metadata">

**Author:** ![Shneyi](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/shneyi/32/2080_2.png) [@Shneyi](https://forum.robotframework.org/u/Shneyi)\
**Post date:** [20 November 2022 19:51 UTC](https://forum.robotframework.org/t/debug-python-db-code-exception-through-robot-framework/4961/4 "2022-11-20T19:51:42Z")

</div>

I will try to debug python created keywords and update here later.
