Submit and vote on feature ideas.

Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

Jython Imort Error when Runnig SOA test scripts from Jeninkins using CLI

Laxmi31
Laxmi31 Posts: 4
edited June 2022 in SOAtest

Hi, I am seeing this error on Jenkins reports when trying to use Jython script to generate random string.
The error is:
Error during script execution. View Details for more information. Traceback (most recent call last): File "", line 1, in ImportError: No module named random

I am using Jython scripts and using "import random, string".
On my local GUI SOA Test tool i added the Jenkins library path in preferences under scripting but i am not sure what to do when i am running th scripts from Jenkins via soatestcli

@benken_parasoft or anyone, Please help. Thanks

Answers

  • benken_parasoft
    benken_parasoft Posts: 1,228 ✭✭✭
    edited June 2022

    On my local GUI SOA Test tool i added the Jenkins library path in preferences under scripting but i am not sure what to do when i am running th scripts from Jenkins via soatestcli

    Are you able to upgrade to the current SOAtest release? SOAtest uses Jython Standalone which includes the Python Standard Library including the "random" module. Now, you can use modules from the Python Standard Library without needing to configure the path to any external Jython installation.

    Otherwise, you can set a "python.home" java system property when running soatestcli:
    soatestcli.exe -J-Dpython.home=c:\jython