Ask a Question

Extracting Relevant Values

MarkSchofer
Frequent Contributor

Extracting Relevant Values

MarkSchofer_0-1624040862586.png

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 6
Marsha_R
Community Hero

Re: Extracting Relevant Values

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
Frequent Contributor

Re: Extracting Relevant Values

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
Community Hero

Re: Extracting Relevant Values

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);

MarkSchofer
Frequent Contributor

Re: Extracting Relevant Values

I personally would rather use scripts. Thanks for this however my directive is to use KW scripts exclusively.   
An example woudl be much appreciated

MarkSchofer
Frequent Contributor

Re: Extracting Relevant Values

I am able to extract values from the web form perfectly where however there is no logic (where statement) to limit what I am extracting

Marsha_R
Community Hero

Re: Extracting Relevant Values

Can you use aqString to pick apart the value that you got? 

cancel
Showing results for 
Search instead for 
Did you mean: