Micro Focus QTP (UFT) Forums
Is the split array method the correct tool for the job? - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: Is the split array method the correct tool for the job? (/Thread-Is-the-split-array-method-the-correct-tool-for-the-job)



Is the split array method the correct tool for the job? - qatestbrian - 01-06-2010

Hi All,

Here is my dilema. I am testing an application that generates a dynamic list of items. There are 25 items to a page. The issue with the items and the reason why a simple regular expression nor simple descriptive programming won't do the trick is that the items I am looking for may or may not be present and the only identifiable properties of the object are the same while the other defining properties are unknown till the application runs. It looks something like this, and I am using a made up example to protect my client:
We have an application that returns the following fields:

Date: DocTitle: record type:
01/02/10 Big Rec 570834090900 New
01/02/10 Small Rec 4579548413 New
12/31/10 Big Rec 02165467456 Old
01/02/10 Small Rec 56416549545 New

Something like that. In the given example if a record can change from New to Old and if a record has a unique number associated with DocTitle and if this list has the same headers but the records or their values can change how do you parse out a record? Mind you if you try to use either DP or Regular Expression for date, you will get many records with exactly the same properties. If you try to use Big Rec or Small Rec, again, those property values are too common and the number following the Big or Small Rec is not known till the application runs. New and Old runs into the same problem. I was trying to apply the Split method to generate an array of the items when the page loads but was having no success. Maybe this method just doesn't work here or maybe I was using it the wrong way. Any help anyone can offer would be greatly appreciated.

Thanks,