The online community for software testing & quality assurance professionals
 
 
Calendar   Today's Topics
Sponsors:




Lost Password?

Home
BetaSoft
Blogs
Jobs
Training
News
Links
Downloads



Testing Tools >> HP Functional Testing / Mercury QuickTest Pro / QTP

Pages: 1 | 2 | (show all)
GregEncke
Member


Reged: 02/11/08
Posts: 277
Loc: Seattle, WA
Re: 'My Beautiful Framework' [Re: Shreejit]
      #704091 - 04/12/12 08:11 AM

Quote:

Quote:

I do a screen shot, exit the test and have a function that closes down resources.




Greg this is what my upper management also wants gracefully exit the test and clean up. But my point is unless its a worst case scneario why should we exit the test (this should be the last resort right?).
The best thing to do would be make qtp recover from the current error and try and re correct itself (as much as possible / proceed with a workaround)




Agreed, you have to know when to leave and when to try again.

--------------------
Patience is like bread I say.... I ran out of that yesterday.


Post Extras: Print Post   Remind Me!   Notify Moderator  
Shreejit
Member


Reged: 03/06/12
Posts: 232
Re: 'My Beautiful Framework' [Re: GregEncke]
      #704222 - 04/13/12 11:21 PM

@lockdown - Amazing stuff

Post Extras: Print Post   Remind Me!   Notify Moderator  
vishimon
Newbie


Reged: 04/13/12
Posts: 6
Re: 'My Beautiful Framework' [Re: lockdown]
      #704255 - 04/15/12 04:56 AM

Good work @lockdown.

We have built a similar GUI based framework in my previous organization.. Likewise to yourself, we have several forms which display the business functions, utility functions, test cases etc. The tester can create new keywords using the GUI or simply reuse the existing ones in his test case.

The major difference is that this GUI is made from Classic ASP (built about 3.5 yrs back) and all the information (except OR) is fed into a SQL database i.e. all keywords, test cases are stored in an Sql database.

The advantages of using such a framework to us was specially
1) No code/script integration hassles i.e. in most of the keyword driven frameworks integrating the excel spreadsheets, OR maps and business functions of testers can be a pain at times especially if there are more than 3-4 of them.

2)Keywords immediately available i.e. Keyword created by Tester A is immediately available to Tester B as soon it is created. This has been one of the biggest gains.

3)The GUI + DB sits on a centralized server. We can actually schedule and execute automation batches on independent machines via the server machine itself. This feature helps us to ensure that the test execution is completed overnight i.e. if the batch is huge we can load this on multiple machines.

4) Using this framework improved our automation productivity as testers were forced to use the correct fn signatures, OR names etc. This was to address the issue we had observed that testers usually got their initial development runs wrong mostly due to spelling mistakes in excel; incorrect parameter given, etc.

The framework was developed in phases and it took us about 6 months to get to the stage we are with this framework.


No one is thinking if everyone is thinking alike !!


Post Extras: Print Post   Remind Me!   Notify Moderator  
JonRLewis
Member


Reged: 11/21/06
Posts: 52
Loc: Yorkshire
Re: 'My Beautiful Framework' [Re: vishimon]
      #704298 - 04/16/12 03:01 AM

I have read a lot of descriptions of Keyword Driven frameworks, and in almost all cases the focus has been on the clever technical aspects of their code - whether its using Data Dictionaries or integrating classes with VB - but almost no thought seems to be given to the interface and the non-technical person who will be using it. As a consequence the end-user is usually expected to remember the name of every keyword and the order and acceptable values of every function parameter. It has been really refreshing to read about some great solutions that have put at least as much effort into the interface as into the application.

My first attempt at a Keyword Driven framework (a couple of years ago) ended up with a VB.Net interface and a SQL Server database. This made it possible to create an interface with pre-populated dropdown lists for the screens, objects, actions and functions, and help text for what everything did and what values could be used, etc. (something very similar to what Vishimon was describing).

I have now moved to a consultancy which led to me looking for a more mobile, transferrable solution and this in turn led me to take another look at spreadsheets. The solution I have arrived at is to split the data from the scripting tool. There is a single Data spreadsheet with worksheets for each application with the following columns: Screen, Object, Object Class, Object ID. Object ID is the DP code for the object and thus eliminates the need for an OR. There is also a worksheet for the functions - columns: Application, Screen, Name, Description, Parameter1, Parameter2, ..., ParameterN. The Parameter columns hold a description of each parameter with permitted vales, etc. There is another worksheet for SubTests with Application, Screen, Name. When you open the Scripting spreadsheet, the first thing it does is use ADODB to query the data spreadsheet pulling out all the application, function and subtest data which is used to make Named Lists to use in Data Validation. Doing it this way means the technical people can update the data and changes are available whenever you open a script. For the scripter, what they get is a series of dropdown lists populated according to the other selections made, i.e. Column A is for Applications - once an application is chosen Column B (Screens) is populated with all the screens defined for the selected application, and so on. Functions can be generic (i.e. not linked to any specific application) e.g. CaptureScreenshot, or linked to a particular application (e.g. Login) or screen. When a function is selected help fields are populated with descriptions of the function and parameters, taken from the data spreadsheet. I have a button on the Scripting spreadsheet that will build a QTP script, and I'm part of the way towards allowing that script to be saved to QC.

--------------------
Jonathan


Post Extras: Print Post   Remind Me!   Notify Moderator  
Shreejit
Member


Reged: 03/06/12
Posts: 232
Re: 'My Beautiful Framework' [Re: JonRLewis]
      #704315 - 04/16/12 05:26 AM

@ Jon - Could you share any snapshot for better clarity?

Post Extras: Print Post   Remind Me!   Notify Moderator  
lockdown
Member


Reged: 02/07/07
Posts: 393
Loc: London
Re: 'My Beautiful Framework' [Re: Shreejit]
      #704319 - 04/16/12 05:44 AM Attachment (78 downloads)

Thanks guys

Database or Excel - I think it all comes down to what you're comfortable developing in. The things that I took into consideration were:

1) With excel we can cut and paste sets of keywords from other tests, use formulas in paramaters (e.g calculate dates for boundary tests), it's an environment people are comfortable using and it's allready installed on the test machines. Plus I know that I can easily extend it through VBA to add more bits in when I need to. Where I'm working, to use anything else would have been too much red tape and procurement of additional programming tools / developer resource.

2) I decided to use the QTP repository feature for the framework - there's a lot about it that I like, especially using the spy to grab all the objects on a gui which I can then tweak, or using the update from application feature. More importantly I knew that I would be training people up to add objects to the framework, so the OR tools in QTP are good for novices. We have to spend a little extra time mapping but that gives us our screenshots and logical structure that you can't always achieve through the OR or DP. Having said that, the way the framework works (execute() command) means I can use DP or even reference a function that returns an object if I wish to.

3) Team structure - With the GUI in place making it easy to use (and restricting input so incorrect values aren't entered) it means manual testers can write scripts, novice QTP engineers can work on mapping tasks, scripting too, and simple programming, and advanced engineers can work on more complicated functions and framework maintenance.

4) QC Integration - There's a 1:1 ratio between QTP test and test workbook which makes QC reporting and metrics easy. The downside to this is that you need a QTP test to represent each test case. I had to develop a tool takes the test workbooks, creates them in QC and then generates a test lab linking to the tests. It's pretty neat and gets a few smiles from people around me who see it as "automating the automation".

5) Maintance - What happens when the GUI/flows change? This is the biggest downside to having all the scripts in separate workbooks. To alleviate the pain, Ive written a search and replace tool that can go through all of the test workbooks, identify specific keywords and replace them with others.

6) How easy will it be to maintain the framework when I leave? All the excel stuff is essentially VBA & macros which alligns closely to the skills of QTP engineers.

7) Efficiency - I've looked at what overheads this approach introduces. The object mapping is made easier by letting users select the QTP objects from a treeview and launching a screenshot snagging tool saves us messing around with print screen and ms paint. So once you've added an object to the OR there's on average a 60 second overhead per object to then map it in the workbook and tag it up correctly. I've attached an example of how this looks if anyone wants some ideas.

--------------------
Automation Blog


Post Extras: Print Post   Remind Me!   Notify Moderator  
Shreejit
Member


Reged: 03/06/12
Posts: 232
Re: 'My Beautiful Framework' [Re: lockdown]
      #704356 - 04/16/12 09:48 AM

@lockdown - Nice stuff buddy

Post Extras: Print Post   Remind Me!   Notify Moderator  
mwsrossoModerator
Veteran


Reged: 09/30/01
Posts: 4974
Loc: Doncaster, UK
Re: 'My Beautiful Framework' [Re: lockdown]
      #704361 - 04/16/12 10:32 AM

Quote:


1) With excel we can cut and paste sets of keywords from other tests




Lock we decided to have a Favourites sheet where the testers can put blocks of often used code that can be called from the Excel test script sheets.

So you can call Favourites lin x yo y and pass/receive any data required, sounds a bit messy but works good.

Mark Smith.


Post Extras: Print Post   Remind Me!   Notify Moderator  
lockdown
Member


Reged: 02/07/07
Posts: 393
Loc: London
Re: 'My Beautiful Framework' [Re: mwsrosso]
      #704396 - 04/17/12 12:50 AM

@Mark: I spotted that on your screenshot, it's a neat idea. We could do with something like a "favorites" menu as searching for the relavent code in another workbook and then copying across is a bit cumbersome.

--------------------
Automation Blog


Post Extras: Print Post   Remind Me!   Notify Moderator  
RPNarayana
Newbie


Reged: 11/04/10
Posts: 22
Re: 'My Beautiful Framework' [Re: Shreejit]
      #706957 - 05/15/12 03:01 AM

Keywords, I follow the following methods
Maintain all the keywords in a Dictionary (giving the details of the keyword)

eg.

Name,
Description (purpose of the Keyword)
Actions (what the keyword does as much detail as possible)
Pre and Post keyword Names(where applicable)

Whoever wants to build the test using the keywords will now have a place to go to when they are unsure of anything.

Also keep the keyword names matching the actual functional or process names which the keyword is related to.

Hope it helps


Post Extras: Print Post   Remind Me!   Notify Moderator  
vampire123
Member


Reged: 09/27/06
Posts: 171
Loc: Washington DC
Re: 'My Beautiful Framework' [Re: JonRLewis]
      #707048 - 05/15/12 02:06 PM

Waht do you mean by a subTest?
Is it possible to share the framework code?


Post Extras: Print Post   Remind Me!   Notify Moderator  
JonRLewis
Member


Reged: 11/21/06
Posts: 52
Loc: Yorkshire
Re: 'My Beautiful Framework' [Re: vampire123]
      #707088 - 05/16/12 01:17 AM

The user can save a series of steps as a SubTest, thus allowing them to create their own 'functions'. For example, they could create a script that launched their application, retrieved a set of credentials and logged on to the application with those credentials. They could save this as a SubTest (call it 'StartApp'), then in their next script they would select the function called RunSubTest and the StartApp SubTest would be available in a dropdown list in the Parameter1 column.

I can't share the code but I'm happy to answer any questions.

--------------------
Jonathan


Post Extras: Print Post   Remind Me!   Notify Moderator  
Mrinal_Nandi
Member


Reged: 04/23/12
Posts: 52
Loc: Mumbai, India
Re: 'My Beautiful Framework' [Re: JonRLewis]
      #707109 - 05/16/12 03:42 AM

All,
Good to see so many people sharing knowledge about frameworks. Got a very good idea about Keyword framework with some UI layers above it.

In my past project, we have developed Hybrid framework which have

1) 3 function file:-
1.a) Generic Function ex Reading the excel, Log file creation, Result updating.
1.b) Application related function ex: Login application, Log out application, search,
1.c)Environment Variable: Global environment variable declaring.

2) Input excels:
2.a) Test case wise data,
2.b) Generic data Ex: URL,USERID,PASSWORD.

3) Log File: Log file created for every execution.

4) Result File: Final result created in HTML format.

5) OR: We have around 100 test case for that we have used Shared OR.

We have used Environment variable like TestDir which can help to make the entire path relative.

--------------------
Regards,
Mrinal Nandi

Follow LinkedIn


Post Extras: Print Post   Remind Me!   Notify Moderator  
mwsrossoModerator
Veteran


Reged: 09/30/01
Posts: 4974
Loc: Doncaster, UK
Re: 'My Beautiful Framework' [Re: Mrinal_Nandi]
      #707121 - 05/16/12 04:47 AM

Something I haven't seen mentioned with an Excel based framework and I know we had to think long and hard about this before we implimented it, was allow recursive looping (For Next, While, Do Loop).

What we eventually implimented was a 'Do Until' Keyword which allowed you to loop until a given condition was True/False or loop a number of times.

has anyone else had to impliment looping in an Excel based framework and what method did you use.

Another thing we implimented was a report that highlighted objects in the OR that were not referenced in any test.

Mark Smith.


Post Extras: Print Post   Remind Me!   Notify Moderator  
Shreejit
Member


Reged: 03/06/12
Posts: 232
Re: 'My Beautiful Framework' [Re: mwsrosso]
      #707319 - 05/17/12 09:09 AM

Hi Mark,

We have tried some luck with DOM for recursively trying to find objects next to objects in a complex web environment
Something like say i want to validate presence of text B next to A on the UI
A:<space>B
On different UI's we have different situations B (could be the nextsibling or B could be nextsibling.nextsibling)
A:<space><space><space>B
We try to loop across till the end of the row till we find B and break out of the loop once the next sibling object is found or object is Nothing
Single keyword called ValidateTextByText() for all UI's but keep it flexible to search across the entire row
Do Until obj.nextSibling.Innertext = "B" OR obj IsNothing
Set obj = obj.nextSibling
Loop
Not the exact code but similar logic


Post Extras: Print Post   Remind Me!   Notify Moderator  
mwsrossoModerator
Veteran


Reged: 09/30/01
Posts: 4974
Loc: Doncaster, UK
Re: 'My Beautiful Framework' [Re: Shreejit]
      #707325 - 05/17/12 10:21 AM

Hi Shreejit, this is a general Loop that will work for all the scenarios we envisaged encountering, things like:

Loop while object exists/not exists.
For Next loop from 0 to UBound for an array.
Loop over the next x lines of code n times.
Loop while a condition is true/false

I try to avoid 'one-off' keyword functions where possible.

Mark Smith.


Post Extras: Print Post   Remind Me!   Notify Moderator  
MJP
Member


Reged: 10/21/05
Posts: 239
Re: 'My Beautiful Framework' [Re: mwsrosso]
      #707343 - 05/17/12 01:57 PM

Hi Mark,
I have a simple loop command that is used in an Excel based framework. On a sheet with work flow commands there are usually some setup actions then a loop statement followed by the rest of the actions. On the first iteration the setup steps run. The following iterations start at the loop statement and skip the setup steps. The number iterations is the length of the data sheet(s).
Regards,
M.


Post Extras: Print Post   Remind Me!   Notify Moderator  
Pages: 1 | 2 | (show all)



Extra information
0 registered and 96 anonymous users are browsing this forum.

Moderator:  IanFraser, Rajkumar_Rajangam, thorwath, TReddy, AJ, Tarun Lalwani, mwsrosso 

Print Topic

Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is disabled
      UBBCode is enabled

Rating:
Topic views: 6428

Rate this topic

Jump to

Contact Us | Privacy statement SQAForums

Powered by UBB.threads™ 6.5.5