Service Virtualization

Expand all | Collapse all

How to compare values two set of excel sheet in LISA itko 7.5

Jump to Best Answer
  • 1.  How to compare values two set of excel sheet in LISA itko 7.5

    Posted 09-09-2016 08:09 AM

    I am trying to compare values two set of excel sheets in  . Each have the same column name . There are more than 900 columns using assertion would not make sense . Once I run read rows from excel files properties are created for each column . However, I cannot find any method to create a list so that I can compare the values through a loop . Can somebody please point me / show me the methods(classes) to use for this case.



  • 2.  Re: How to compare values two set of excel sheet in LISA itko 7.5
    Best Answer

    Posted 09-12-2016 01:24 PM

    I have not tried to accomplish this requirement using DevTest so treat everything below as an unproven idea that may or may not work.

    Option 1:

    1) Create a test case step that reads the first dataset and stores the information (Key/Value) in a List object

    2) Create a second step that reads the second dataset and stores the information in a different List object

    3) Add a JSR-223 step that compares the two lists and provides the necessary response

     

    Option 2:

    Look for a method in the DevTest framework that can help you.  For example,  testExec.getLocalDataSet("dsNameHere") might give you a handle to each of the dataset objects. Perhaps, your code could access a method to return a list of key values or an XML representation that you could perform an assertion on.   You would need to review the class hierarchy to determine if this approach is feasible or not.

     

    Option 3:

    Read the first dataset in a test case, create a for loop that calls a subprocess.  Pass each only the column name and value to the subprocess.  In the subprocess, access the second dataset and compare column name and value.  Return the result of the comparison.

     

    You may bump into an issue when referencing a column name [i.e., testExec.getStateValue("colNameA") ] since it appears that both datasets share exactly the same column name.  In the above, there is no distinction on the property name called colNameA as to which dataset it belongs.  Hence the reference in Option 1 to processing the dataset into a list that can be referenced later.