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.

How to dynamically create a SOATest workspace and add a project/tst (Through command line)

ab1_soatest
ab1_soatest Posts: 2
edited January 2017 in SOAtest

Hello Everyone

I have a query for SOATest 9.7, we are trying to achieve following to test things without any manual intervention when a build/merge happens. Struggling to achieve step 2 & 3. Could someone please help.

  1. On some test machine, checkout latest copy of a SOATest suite from SVN/Git
  2. Create a SOATest workspace dynamically though command line .....{How to achieve this, i tried with "soatestcli -data "c:\path to workspace" : It creates the workspace but also Getting error like "Error: Missing parameter: -config, Exception in thread "Thread-4" java.lang.IllegalStateException: Store for:env.preferences not registered"}
  3. Map SOATest project (from step 1) to SOATest workspace(created in step 2) dynamically (though command line) .....{How to achieve this, right now we do it manually by opening workspace and import existing project to establish a logical link}
  4. Run the test suite through soatestcli.exe.
  5. Publish reports to Jenkins
Tagged:

Comments

  • benken_parasoft
    benken_parasoft Posts: 1,228 ✭✭✭

    I use soatestcli -import %ECLIPSE PROJECT%

    See Parasoft SOAtest User's Guide > Setup and Testing Fundamentals > Running SOAtest > Testing from the Command Line Interface (soatestcli) > cli Options

    Concerning "Publish reports to Jenkins", see https://wiki.jenkins-ci.org/display/JENKINS/Parasoft+Findings+Plugin

  • sravan_daruvuri
    sravan_daruvuri Posts: 6

    I tried to use -import option but the eclipse projects gets imported to the default workspace which is as per documentation.
    How do we specify the directory where the project needs to be imported.

  • Ireneusz Szmigiel
    Ireneusz Szmigiel Posts: 227 ✭✭✭

    Hi sravan_daruvuri

    use:

    soatestcli -data Your_Workspace_here -import %ECLIPSE PROJECT%

  • sravan_daruvuri
    sravan_daruvuri Posts: 6

    Thank you !
    I just figured it out that we can use data option to provide a workspace

  • sravan_daruvuri
    sravan_daruvuri Posts: 6

    Tried to run the workspace I created using the above command but my tests failed with ClassNotFound exception.

    Some of the scripts invoke custom java classes from the Jars. How do I add these jars to the classpath ? These are added to the System Properties under preferences in IDE.

    I tried using -classpath and provided the location of the jars, but no luck

  • jakubiak
    jakubiak Posts: 795 admin

    Adding the jars under System properties is how you add the classes to your classpath. Make sure you click the Reload button on the System Properties preferences page (or restart the product) after adding the jars to ensure that they get loaded. Also make sure you include any jars that your jars depend on.

  • Ireneusz Szmigiel
    Ireneusz Szmigiel Posts: 227 ✭✭✭
    edited May 2017

    Hi sravan_daruvuri

    you have to be more precise with description of problem.
    Command soatestcli -data Your_New_Workspace_here -import %ECLIPSE PROJECT%
    can be used only to import test/tests into new workspace, however it can not be used to run test/tests.
    Importing of test should be first step, then you have to call soatestcli one more time but without -import option.

    If you you are using soatestcli to run test with Jenkins then you have two options:
    1.Setup System Properties in GUI for your workspace ( Your_New_Workspace_here) as @jakubiak mentioned.
    2.Use option -localsettings with file name to provide location of required jars

    With option 2 command line for Jenkins may looks like following
    soatestcli - data Your_New_Workspace_here -localsettings localsettings.properties -config "builtin://Demo Configuration"

    How to create localsettings.properties file you can find in SOAtest help system or user manual, section "Testing from the Command Line Interface (soatestcli)" and Parasoft Test User’s Guide (Parasoft Test User’s Guide> Configuration> Specifying Localsettings)

    See how to define system.properties.classpath in localsetting.properties file.
    system.properties.classpath property allows you to define location of required jars when you don't have access to GUI

  • sravan_daruvuri
    sravan_daruvuri Posts: 6

    Thank you, but the steps are when we want to add the Jars through IDE.
    How do we do provide the Jars when you trying to run a newly created workspace and imported the project from a different directory

  • Ireneusz Szmigiel
    Ireneusz Szmigiel Posts: 227 ✭✭✭
    edited May 2017

    2.Use option -localsettings with file name to provide location of required jars

    With option 2 command line for Jenkins may looks like following
    soatestcli - data Your_New_Workspace_here -localsettings localsettings.properties -config "builtin://Demo Configuration"

    How to create localsettings.properties file you can find in SOAtest help system or user manual, section "Testing from the Command Line Interface (soatestcli)" and Parasoft Test User’s Guide (Parasoft Test User’s Guide> Configuration> Specifying Localsettings)

    See how to define system.properties.classpath in localsetting.properties file.
    system.properties.classpath property allows you to define location of required jars when you don't have access to GUI

  • jakubiak
    jakubiak Posts: 795 admin

    An easier way to add jars in a dynamically created workspace is to follow the following tip from the SOAtest users guide:

    Tip: Adding Jar Files in Bulk and in Headless Instances

    If you want to quickly add a large number of jar files—or add jars to a headless instance of SOAtest— simply copy them into the TestAssets/system_jars or stubs/system_jars directory within your workspace. Jar files in those two directories will be automatically loaded upon startup, or after Reload is clicked in this Preferences page.

    On a "headless" instance, if you want to reload the jars without having to restart SOAtest, call post /v/preferences/systemProperties/reload from the SOAtest REST API

    From your CLI script that is creating the workspace using -import you could copy your jar files into the location mentioned - or to simply have the jars present in the workspace that you are importing.

  • sravan_daruvuri
    sravan_daruvuri Posts: 6

    Let me give both the options a try and post the results about my tests

  • Ireneusz Szmigiel
    Ireneusz Szmigiel Posts: 227 ✭✭✭

    That's right but @sravan_daruvuri you have to use SOAtest v9.9/9.10 if you want to add Jar Files in Bulk.
    With SOAtest v9.7 use localsettings

  • jakubiak
    jakubiak Posts: 795 admin

    Good catch @Ireneusz Szmigiel

  • sarbani
    sarbani Posts: 1

    Hi,

    I am running my soatest suite frequently, but after every run I have to click manually on report generation icon to save the html report.
    I want to save my report of each run in my local folder automatically after each run- without clicking on any report generation icon.
    Please let me know.

  • jakubiak
    jakubiak Posts: 795 admin

    Hi @sarbani, your question is probably better addressed in a different topic since this one is about CLI and you are asking about generating reports from the desktop. From desktop there is currently no way to automatically save the report in a folder - you can only do that from CLI.

Tagged