Geeks With Blogs
Maryanne's Blog Another Geek with A Blog

In the course of my growth as an automation engineer, I have come to the end of the "salad days."

In my own self estimate, I am a wee infant when it comes to automation.  Up until last week, I had been standing on the shoulders of giants, gifted beyond my own experience, and essentially wiring up the components they  had already built.

The luxury of already built and stable components came to a screeching halt last week.  In the words of Boss Man, "the low hanging fruit is exhausted."

Now I have moved into the realm of building my own components.  I thought I was starting with something simple but like all things worth doing the devil is in the details.  And this turned out to be much more complicated than I had originally thought it would be.

The first component was the easy one:  Build a component which will launch a web form and populate the data on the form based on passed in parameters (like Product Type for example).  That one was easy and as far as I can tell, for the most part it is quite stable.

The second component was more complicated.  This component will go to the database and extract data from an audit table based on the Field type passed to it.  Once the data is captured, the extracted data is sent to the Global Datasheet for future use in the master driver script.  This one wasn't so bad.  The SQL used to extract the data is the same excluding the Field Type.  What became tricky was discovering that there were 15 field types I needed to watch for depending on Product Type.  To get around the need to construct a component for each field type, I used QTP's parameter method and will pass the Field Type in as a parameter.  Where the code gets ugly is that as a result I have a 15 member Select Case statement to handle each Field Type.  Its not pretty but it works. 

The last component was the most complicated of all.  It uses the same database table as the second query but in this case it is going to compare the data used in component 1 to the data found in the database.  The table we are working against is an audit table which captures Original and Modified data.  So there is an "OldValue" column and a "NewValue" column.  The second component gets all the old values based on the Field Type sent in.  This one compares the value stored in the "NewValue" column with the data in the DataTable used in Component 1 to complete the form in the first place.  It uses the same Select Case structure as Component 2 but what I ran into with this one is that some of the fields were actually calculated based on data entry.  So I had to do some number crunching before I compared the values.  This was a trial b/c I wasn't 100% sure what was being used for calculations.  A little scratch paper and some trial and error fixed that though.

After a week's worth of whittling at this problem, I think I have the code down so these components will work for 5 different product types. 

I started building the first driver script on Friday and I completed it today.  Again, not necessarily the prettiest code on the block but it does what I need and seems to be stable.  Once the code reviews are done, I can feel more comfortable about it.

However, as my first foray into building components from the ground up, I do feel like I may be getting the hang of this new role.

Just have to remember that my VBScript Programmer's Reference 2nd addition and Advanced QTP manuals are my best friends. 

Posted on Thursday, July 5, 2007 11:32 AM QuickTest Pro | Back to top

Comments on this post: Alas, No More Low Hanging Fruit

No comments posted yet.
Your comment:
 (will show your gravatar)

Copyright © Maryanne Sweat | Powered by: