Service Virtualization

Expand all | Collapse all

Write to delimeted file feature of Ca DevTest not working

  • 1.  Write to delimeted file feature of Ca DevTest not working

    Posted Jan 24, 2019 03:23 AM

    Hi All,

     

     

    i hava a test case which is running fine in ITR where i have write to delimited file step (Generating CSV file for me).

    as when i am running with other running option like (Staging, Through Suite, Test Runner, deployed to CVS), in results all steps are passing , but my CSV file is not generating in local directory.

     

    Could any one please help or it could be an issue with my devTest version.

    Current version is 10.2.4.153



  • 2.  Re: Write to delimeted file feature of Ca DevTest not working

    Broadcom Employee
    Posted Jan 24, 2019 03:57 AM

    I think the first thing to validate is in those cases when you are not running ITR whether the simulator running your test case is running "local"?

     

    I assume "local" means where your workstation is running? What happens if you "Stage a quick test", then select "Stage Local (no coordinator server)"? Still no file?

    If no file then look in workstation.log or alternatively use the System Messages button to see if there is no error listed.

     

    Cheers,

    Danny



  • 3.  Re: Write to delimeted file feature of Ca DevTest not working

    Posted Jan 24, 2019 08:20 AM

    yes danny, After looking into system messages, i found null pointer exception along with INFO - Could not clean up temporary extracted MAR: 9AEE18901FD911E986A2525320524153.

     

    PFB snap:

     



  • 4.  Re: Write to delimeted file feature of Ca DevTest not working

    Posted Jan 24, 2019 08:32 AM

    WARN which continuously coming is WARN - Unable to delete temporary mari file C:\Program Files\CASV\Projects\projectName\Tests\Suites\_suite_.mari.

     

    Any suggestions ??



  • 5.  Re: Write to delimeted file feature of Ca DevTest not working

    Broadcom Employee
    Posted Jan 24, 2019 07:39 AM

    As per our documentation:

     

    Be aware of the following warning when writing to a delimited file. The Data directory can be used as the location of the CSV file only if both tests support rerun. The first test must be run again to create the CSV in the lads folder so the second test can run. The lads directory stores files temporarily while a test case or suite is running.

     

    Write to Delimited File - DevTest Solutions - 10.2 - CA Technologies Documentation 



  • 6.  Re: Write to delimeted file feature of Ca DevTest not working

    Posted Jan 24, 2019 10:25 AM

    Marcy, i checked lads directory, my expected CSV file is generating over there under Data folder, when staging test case locally.

    however when checking to my local project directory Data folder, its not getting created.



  • 7.  Re: Write to delimeted file feature of Ca DevTest not working
    Best Answer

    Broadcom Employee
    Posted Jan 25, 2019 05:35 AM

    How is your directory path defined in the step? It is probably using {{LISA_PROJ_ROOT}} or {{LISA_RELATIVE_PROJ_ROOT}}.

     

    When you stage a test and even if you define to "stage it locally" then a .mar file is created under the covers and than that .mar file is unpacked by the coordinator into the lads directory. So your {{LISA_PROJ_ROOT}} is not anymore your local project directory. The lads directory is now your {{LISA_PROJ_ROOT}} while running a staged test.

     

    Put your local project data directory path hardcoded in the step and then you will see the csv created there.

     

    Obviously later at "in production circumstances" when running your test you will need to define a path that is accessible by the coordinator+simulator that will be running your tests.

     

    Cheers,

    Danny



  • 8.  Re: Write to delimeted file feature of Ca DevTest not working

    Broadcom Employee
    Posted Jan 25, 2019 05:41 AM

    And by the way, re.

     

    WARN which continuously coming is WARN - Unable to delete temporary mari file C:\Program Files\CASV\Projects\projectName\Tests\Suites\_suite_.mari.

     

    I think the warnings you are seeing are rather harmless. I don't think they are related to your .csv file issues.



  • 9.  Re: Write to delimeted file feature of Ca DevTest not working

    Posted Feb 01, 2019 02:57 AM

    Thanks Danny,

    Its creating a file now.



  • 10.  Re: Write to delimeted file feature of Ca DevTest not working

    Posted Feb 01, 2019 05:37 AM

    One quick question,

    As now i am running my test locally with no coordinator server, and  i am getting expected CSV file after hardcoding path.

    but, when i am trying to stage or delpoy my test to central Coordinator+simulator server, my CSV file is not generating.

    Do we need to alter my  path, as my all server components are up and running on one centralize machine.

     

    Thanks for your input



  • 11.  Re: Write to delimeted file feature of Ca DevTest not working

    Broadcom Employee
    Posted Feb 01, 2019 06:00 AM

    Yes, I understand you are referring to what I mentioned above 'Obviously later at "in production circumstances" when running your test you will need to define a path that is accessible by the coordinator+simulator that will be running your tests.'

     

    So, you will have to 'design' this, create a location where you want this CSV file to be created, a lot depends on how and who is going to consume this generated file. One solution is to create the file in a directory which itself is shared over the network, now anyone who needs the file (and has access permissions) can get to it.

     

    Also be aware that using the staging document you can direct the execution of the test case to one particular Simulator, that can be a simulator on some dedicated host where the Simulator is the only DevTest process running (so this Simulator connects to registry and coordinator on central machine).

     

    Cheers,

    Danny 



  • 12.  Re: Write to delimeted file feature of Ca DevTest not working

    Posted Feb 01, 2019 06:32 AM

    Are you saying, i need to design a path of location, where my Server components are running

     

    Because, if i create a path of my shared drive or any other directory, anyhow my file is not going to generate as i checked doing that.

     

    Reffering This (One solution is to create the file in a directory which itself is shared over the network, now anyone who needs the file (and has access permissions) can get to it.).

    how do i create a file over that directory ??
    Simply giving a path will resolve the issue??



  • 13.  Re: Write to delimeted file feature of Ca DevTest not working

    Broadcom Employee
    Posted Feb 01, 2019 07:01 AM

    Ok, not sure what you tried exactly and what you find not working.

     

    First of all, "hardcoded" has been mentioned a few times above but it is more correct to speak of an "absolute" path (instead of a hardcoded path). So use an absolute path, not a relative path. With an absolute path you control where in the file system the file gets created (as opposed to a relative path then the file gets created relative to the directory in which the Simulator process was started).

    Also, in your step you should use a property for your absolute path, eg. {{AbsolutePathCSV}} and define that property in your .config file. That way you can do testing/debugging in your workstation using a config file with a local absolute path, while in "production" your config file contains the correct path on your server.

     

    Secondly, the production absolute path needs to be comply to the rules of the operating system of your DevTest server, locally you might run windows, but your "production" simulator might be running on Linux.

     

    Thirdly, I suggest that you make sure that the destination directory on your Simulator host already exists and is first of all accessible by the userId that runs/owns the Simulator process. (Meaning your user should be able to do a "cd" to that directory) Also, in addition to be able to access that directory, that userId also must have the rights to write in that directory.

     

    If the above 3 points are taken care of then you should be able to let your "production" simulator create a CSV file.

     

    Cheers,

    Danny



  • 14.  Re: Write to delimeted file feature of Ca DevTest not working

    Posted Feb 01, 2019 07:28 AM

    Thank you Danny, will surely try this.