Parameter for Frameworks
I was having a few thoughts today about keyword driven frameworks, I have created one in QTP where the “Main” vbs file is composed of a loop and select statement. I then have different vbs files splitting them up by the type of components (textbox, combobox, listbox…) and inside of these files are select statements for all the possible types of actions one can perform on that component. So a typical data sheet (I use excel) will look like this:
Window Component Action Parm1
Flights TextBox SetText 2008/01/01
Flights ListBox SelectItem London
Flights ListBox SelectItem China
Flights PushButton PressButton Save
So this particular data sheet is supposed to mimic saving 1 trip in the flights program. Now if I wanted to save another trip, I would copy and paste the lines and change the two locations. So if I wanted to save 10 trips, I would have quite a bit of lines in my excel, its not very difficult…but I was trying to think of a way where I can keep these four lines but somehow loop it so London and China would be parameterized read from another sheet, but keep saving each one.
I don’t know if I’m wasting my time, or trying to make my scripts more complicated than it should be, but if anyone has ideas or comments I’d would love to hear them.
Re: Parameter for Frameworks
Separate the data from the process steps (like when using data tables in a recorded script). You can then simply loop through the entries by creating a keyword to indicate which data rows to run through.