Debugging Scripts in Jython

Grigori TrofimovGrigori Trofimov Posts: 77 ✭✭
edited September 2018 in SOAtest

From an existing customer, but I figure I would post here:

Can you recommend how we debug Jython scripts, which we’re planning to use within SOAVRT as “shared” scripts we can distribute to teams?
Should we need use Eclipse and PyDev?


  • benken_parasoftbenken_parasoft Posts: 895 ✭✭✭
    edited September 2018

    You could write your shared python modules and test/debug them with unit tests. Yes, PyDev could assist with this (see unit test integration). After your python modules are written and tested, then you could start referencing them from SOAtest test cases. You would not use SOAtest to test or debug the scripts themselves. Rather, from SOAtest, you want to use your scripts as a part of testing and debugging your application under test. For visibility as to what your scripts are doing when executed from SOAtest test cases, you could add your own logging to your scripts.

  • Grigori TrofimovGrigori Trofimov Posts: 77 ✭✭

    Very helpful recommendation! Thank you!

  • bennetcolebennetcole Posts: 1

    Python has a debugger , which is available as a module called pdb . It supports setting conditional breakpoints , stepping through the source code one line at a time, stack inspection, and more.

    import pdb
    msg = "this is a test"

    Insert pdb.set_trace() anywhere and it will function as a breakpoint . When you execute the script by python, you will in the debug mode.

Sign In or Register to comment.