Running a soatest with excel data source with maven is failing the test

Sourabh25Sourabh25 Posts: 37
edited March 2018 in SOAtest

Hi,

I am trying to execute a soatest with datasource as excel. Find below the conbfiguration

It is working fine when I am executing the soatest
Now when I am trying to execute the same test through maven it is failing with the below error

project.tst - Test Suite: ParentTestSuite/Set-Up Tests/Set-Up 1: Authentication
C:\Users!abcd\AppData\Local\Temp\parasoft.workspace\TestData\testdata_QA.xlsx (The system cannot find the path specified)

my POM.xml

Tagged:

Comments

  • Ireneusz SzmigielIreneusz Szmigiel Posts: 203 ✭✭

    @Sourabh25
    In SOAtest you are using variables which are resolved duing execution into:
    C:\Users!abcd\AppData\Local\Temp\parasoft.workspace\TestData\testdata_QA.xlsx
    I'm not sure if such path is correct.
    Do you have such location on machine where maven runs tests?
    I think that you should have something like this:
    C:\Users\abcd\AppData\Local\Temp\parasoft.workspace\TestData\testdata_QA.xlsx

    See missing "!" (exclamation mark)?
    What happen if you replace configuration string with variables in SOAtest with real path?

    --
    Ireneusz Szmigiel
    http://www.catb.org/esr/faqs/smart-questions.html

  • Sourabh25Sourabh25 Posts: 37

    ! is typo... I am getting the error as
    project.tst - Test Suite: ParentTestSuite/Set-Up Tests/Set-Up 1: Authentication
    C:\Users\abcd\AppData\Local\Temp\parasoft.workspace\TestData\testdata_QA.xlsx (The system cannot find the path specified)

  • Ireneusz SzmigielIreneusz Szmigiel Posts: 203 ✭✭

    @Sourabh25

    What happen if you replace configuration string with variables in SOAtest with real path?
    Do you have Excel file in such location? OS reports that there is no such path.

    --
    Ireneusz Szmigiel
    http://www.catb.org/esr/faqs/smart-questions.html

  • Sourabh25Sourabh25 Posts: 37

    Please find below the maven log

    T E S T S

    Running com.abc.parasoft.Project.AppTest
    Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.022 sec

    Results :

    Tests run: 1, Failures: 0, Errors: 0, Skipped: 0

    [INFO]
    [INFO] --- maven-parasoft-plugin:3.13:soatest (soatest-test) @ Project ---
    [INFO] Deleting C:\Users!FRICT~1\AppData\Local\Temp\parasoft.workspace
    soatestcli: Version 9.10.0.20161130 -- Copyright (C) 2016 Parasoft Corporation
    soatestcli: Version 9.10.0.20161130 -- Copyright (C) 2016 Parasoft Corporation
    INFO: Scope not specified: No resources specified as scope, using all workspace projects as selected scope.

    [0%] Running: Scope
    [3%] Computing scope

    [3%] Initializing
    [5%] Refreshing workspace
    [5%] Opening 'Project'.
    [5%] Refreshing workspace
    [5%] Refreshing '/Project'.
    [9%] Refreshing workspace
    [9%] Building
    [9%] Project
    [9%] Building
    [9%] Invoking 'Java Builder' on '/Project'.
    [9%] Preparing to build Project
    [9%] Cleaning output folder for Project
    [9%] Copying resources to the output folder
    [9%] Cleaning output folder for Project
    [9%] Copying resources to the output folder
    [9%] Analyzing sources
    [9%] Compiling OrionMiddleware/src/main/java/com/comcast/parasoft/Project
    [9%] Compiling OrionMiddleware/src/test/java/com/comcast/parasoft/Project
    [9%] Build done
    [9%] Building
    [9%] Invoking 'Maven Project Builder' on '/Project'.
    [9%] Building
    [13%] Finding files
    [17%] Applying scope filters
    [19%] Computing lines to check
    [25%] Reporting scope results

    Total Files: 1
    Source Files to Check: ---
    Total Source Lines: ---
    Source Lines to Check: ---
    Test Data Files: 1
    Excluded Files: 0

    [31%] Running: Execution

    [38%] Precomputing types in the selected scope
    [39%] Finding types
    [39%] Computing selection
    [39%] Finding types
    [39%] Computing tests to run
    [39%] Adding extra files
    [39%] Computing tested types
    [39%] Computing tested types for Project
    [39%] Computing tested types
    [39%] Finding types
    [40%] Computing tested members
    [40%] Computing unit tests

    [40%] Execution: launching tests
    [40%] Running ScheduleService.tst

    [40%] Running Set-Up 1: Authentication, id=wk:///Project/ScheduleService.tst#0000000000#0000000975, Seconds elapsed: 2s

    [58%] Finished running tests
    [61%] Performing post-testing tasks...

    Executed Test Cases: 1
    Passed: 0 Failed: 1 Skipped: 0
    Functional Failures: 0
    XML Validation Errors: 0
    Miscellaneous Errors: 1
    Change Impact: 0

    [78%] Finished
    [80%] Generating reports
    [100%] Done

    [SOAtest] writing stubs.xml
    [SOAtest] Writing to C:\Users\username\AppData\Local\Temp\parasoft.workspace\stubs\stubs.xml
    [SOAtest] 03/16 02:30:49 PM Shutting down current deployments.
    03/16 02:30:49 PM Shutting down current deployments.
    [SOAtest] 03/16 02:30:49 PM Shutdown of deployments finished.
    03/16 02:30:49 PM Shutdown of deployments finished.
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD SUCCESS
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 01:49 min
    [INFO] Finished at: 2018-03-16T14:31:05-04:00
    [INFO] Final Memory: 20M/48M
    [INFO] ------------------------------------------------------------------------

    I am using the command
    mvn clean test -Dparasoft.soatest.home="C:\Program Files (x86)\Parasoft\SOAtest\9.10" -Dparasoft.localsettings="C:\Program Files (x86)\Parasoft\SOAtest\localsettings"

    it seems after running the junit test maven is cleaning the workspace and after that the soatest execution is taking place.

  • Sourabh25Sourabh25 Posts: 37

    As a result maven is not able to refer to the excel sheet in the workspace as it is already deleted

  • Sourabh25Sourabh25 Posts: 37

    Does my project in java perspective look correct?

  • Sourabh25Sourabh25 Posts: 37

    Any help on this. Please let me know if any more information is needed?

  • benken_parasoftbenken_parasoft Posts: 721 ✭✭✭
    edited March 2018

    To clarify, the "soatest" maven goal is simply a driver for the SOAtest command line interface (soatestcli). The console output from soatestcli is what you see printed along with the other maven output. The console output does not show test failure detail. The soatestcli will generate a SOAtest HTML report with such details. I assume the SOAtest HTML report where you are seeing "The system cannot find the path specified" test failure being reported.

    Please be aware that the Parasoft maven plugin is going to tell soatestcli to run all the tst files within a SOAtest project folder. Typically you create your project in SOAtest UI, create a bunch of tst files inside of it, then manually add a pom.xml so you can drive the execution from maven. When you run "mvn clean test" from your SOAtest project, the Parasoft maven plugin will generate a workspace directory in your TEMP folder, import the SOAtest project (the one containing the pom.xml), then execute soatestcli to run all the tst files in that same SOAtest project. When I say "import the project" I just mean registering the SOAtest project within that workspace. Your SOAtest project still lives where you had it when you ran maven on it (no files are copied/moved to that dynamically generated workspace).

    Therefore, paths like "${workspace_loc}/SomeProjectName" will never work. Your project folder does not live under the workspace directory in this context. In general, project locations and workspace locations are totally independent of one another. You should never use paths that are referencing project files under ${workspace_loc}.

    This also means your workspace will only have one project imported, the one with the pom.xml which contains all our tst files you would be executing. For example, you can't have a second project folder called "TestData" then reference files with "${workspace_loc}/TestData" or even "${project_loc:TestData}". You need to look at the .project file for your SOAtest project, next to where you added your pom.xml. It has the name of the project that is being imported into the workspace. This is the only project name you can reference from any tst files with paths like "${project_loc:SomeProjectName}", for example. However, you can do relative paths like ${project_loc:ProjectWithMyTstFiles}/../TestData/my_excel_file.xlsx". Or even better, if you like Maven's standard directory layout, you can also consider putting test resources under "src/test/resources" and reference them from your tst files like "${project_loc:ProjectWithMyTstFiles}/src/test/resources/my_excel_file.xlsx"

  • Sourabh25Sourabh25 Posts: 37

    Thanks a lot @benken_parasoft for the detailed explanation. I somehow was able to figured it out today by myself. And with $(project_loc) i was able to successfully able to get the data from the xls file.
    The explanation given by you make a lot of sense to me now. Thanks again

Sign In or Register to comment.