Forum Discussion

MarkSchofer's avatar
MarkSchofer
Frequent Contributor
3 years ago

Extracting Relevant Values

I have developed a routine where I extract from a spreadsheet and Navigate accordingly. 

Can one simply extract from this table and process as need fit. ------** Into excel

Basically I want to match by check data and check amount.  (I already have them in variables)

Suggestions needed as I will be looping through a many rows of data and the extract changes every time.

6 Replies

  • Marsha_R's avatar
    Marsha_R
    Champion Level 3

    So, you have some of the data in variables and you want to look up a row in that table that contains the matching data?  Is that it?

    • MarkSchofer's avatar
      MarkSchofer
      Frequent Contributor

      Marsh that is exactly correct. I have check date and check amount in variables.  The spreadsheet has 30 plus values but I am using these. 

      • Marsha_R's avatar
        Marsha_R
        Champion Level 3

        I have forgotten if you are scripting or using keyword tests.  If you need this for keyword I can work out an example.

         

        For scripting, you can use the example here with an addition for your criteria something like this.  No warranties on my syntax or logic   ğŸ™‚

        https://support.smartbear.com/testcomplete/docs/testing-with/data-driven/drivers.html

         

         

        {
          while (!Driver.EOF() AND !((MyDate = ExcelDate) AND (MyCheckAmount = ExcelAmount))
          Driver.Next();

        //while these are both true, keep looping
        }

         

        // see if you stopped because of data found or data done
        if ((MyDate = ExcelDate) AND (MyCheckAmount = ExcelAmount))

        then get the rest of the row data

        else

        log message "data not in Excel"


        DDT.CloseDriver(Driver.Name);