Service Virtualization

  • 1.  Can we colour any row of csv file in lisa based of any pass/fail status

    Posted Sep 20, 2017 03:18 AM
      |   view attached

    Hi guys,

     

    I am storing my devtest property data in csv file and added some java code in javascript component to verify certain condition and then making status as Pass or fail

    now my requirement is to color the Pass status row in Green and Fail status row in red

     

    Could any one suggest how can i do it in Ca Devtest.

    I tried below options:

    1)   tried accesing csv file from java code and then colring it, but failed to it

    2)   Converting csv file to xlsx format then trying to color it, but when i am converting it excel is showing file got corrupted

     

    Please help me out.

    Attaching the sample csv file

     

    Thanks,

    Sabir Sayyad

    Attachment(s)

    zip
    Reports.csv.zip   303 B 1 version


  • 2.  Re: Can we colour any row of csv file in lisa based of any pass/fail status
    Best Answer

    Broadcom Employee
    Posted Sep 20, 2017 01:35 PM

    Ah, now I understand your previous question.  Sorry.

     

    You cannot add color to a CSV file - only a *.xls file.

     

    DevTest does not provide a native way to create an Excel document.  However, you could write a Java extension that uses the Apache POI library.  POI was created for manipulating Excel workbooks.

     

    https://poi.apache.org/

     

    I think the Apache POI library is already part of the DevTest distribution, so you might not need to explicitly add the jars (but I could be wrong).

     

    --Mike



  • 3.  Re: Can we colour any row of csv file in lisa based of any pass/fail status

    Posted Sep 20, 2017 02:36 PM

    Yes Mike, I could do all manipulations to xlsx file through POI, but now as Devtest allow us to store our data in CSV file only and then manually I have to open that CSV file and again need to save in excel file format

     

    This is an manual process which I want to avoid.

    So, I am looking for any alternative like by writing any java code or other to do this.

     

    Please suggest on this, I just want to make everything Automatic, no manual intervention.

     

    Hope you understand my situation

     

    Actually I need to automate such scenarios



  • 4.  Re: Can we colour any row of csv file in lisa based of any pass/fail status

    Broadcom Employee
    Posted Sep 20, 2017 05:21 PM

    Hi Sabir,

     

    Yes, that's what I was suggesting - write Java code that executes automatically when you run a test.

     

    You have 3 options:

     

    1) The "Execute script (JSR-223)" step.  This is the fastest approach, but testing can be tedious.

     

    2) The "Custom Test Step Execution Step" allows you to implement a DevTest interface that you place in a JAR and drop into the hotDeploy folder.  This gives you a simple configuration UI and, because it uses compiled code, it's easier to use if you need this step in multiple places.

     

    3) Create a custom "native" test step.  This is the most complex solution since you'll also need to code a Controller and View (and some other configuration).  However, you can code your own UI.  This is how the CA development staff creates all of the standard steps.

     

    The documentation for #2 and #3 are here:

     

    https://docops.ca.com/devtest-solutions/10-1/en/using/using-the-sdk/extending-test-steps

     

    --Mike



  • 5.  Re: Can we colour any row of csv file in lisa based of any pass/fail status

    Posted Sep 21, 2017 07:17 AM

    Thanks Mike for your suggestion, i will try all provided options