cancel
Showing results for 
Search instead for 
Did you mean: 

How can we implement a keyword driven automation framework in test complete for Desktop application?

SOLVED
Occasional Contributor

How can we implement a keyword driven automation framework in test complete for Desktop application?

 I am trying to implement a keyword driven framework using test complete, and can anyone help me as to how to go about it , and what approach should i take to achieve this.

 

 

 

3 ACCEPTED SOLUTIONS

Accepted Solutions
Community Hero

Re: How can we implement a keyword driven automation framework in test complete for Desktop applicat

1. Store objects in some XML\Excel file as an object repository and read the objects in script and perform actions?

 

This is the common method most of the automation testers following, I think this has some has limitations like below,

 

  • You can't use the Extended Find[which is in-built option of Test Complete].
  • You may not be able to automate dynamic objects.
  • You can't descriptive programming.
  • I feel Maintenance would be nightmare if we use objects in Excel sheet. 

 

2. Store it in Name mapping file? This is little risky i feel when the application(want to automate) is in development state the control properties may keep changing. Every time I may have to change object properties in script?

 

  • All limitations in 1. can be done if you use Name mapping.
  • Usually, In scripts we will use only the property name not the property value hence if the object type changes then only we need to touch the script.
  • When it comes maintenance in objects then TC would be greatly assisted with the Namemapping with images[which is new feature of Test Complete], Advanced properties of an Object and etc,.

So overall, I would prefer Namemapping is the best option go!

 

I love be in the Automation framework development phase Smiley Happy but we already crossed that stage.

 

Anyways, Enjoy your coding on your new framework.


Thanks
Shankar R

LinkedIn | CG-VAK Software | Bitbucket | shankarr.75@gmail.com

“You must expect great things from you, before you can do them”


Extension Available

Community Hero

Re: How can we implement a keyword driven automation framework in test complete for Desktop applicat

As @shankar_r, if you use NameMapping properly and use properties that don't change as frequently, then you'll find very little you'll have to update when development changes the objects. Extended find helps when object hierarchy changes and, as noted, with the new image mapping in 12.30, some of this really gets cleaned up.  Updating NameMapping is not as hard as it sounds, it just takes a bit of awareness of what kinds of properties make for good mapping.

 

Storing objects in Excel and/or XML you would still need to translate them some way into TestComplete for it to recognize how to click on, key on, or other wise interact with the objects.  You'd probably end up having to use FindChild or FindAllChildren or similar functions which require you to utilize the same sorts of properties for searching as you would end up using in NameMapping anyways.  You would end up actually having to edit automation code where as using NameMapping, all your object identification factors are in one central location.

 

When it comes down to it, when your application objects change, you'll have to make a change SOMEWHERE.  So, since the tool provides the method, seems a bit cumbersome to write your own.  Others do it, but I find that using the native feature of the tool makes for less maintenance over all.


Robert Martin
[Community Expert Group]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Extensions available
Community Hero

Re: How can we implement a keyword driven automation framework in test complete for Desktop applicat

You still need to convert the string WPFObject("window").WPF("button").click() into objects and methods to be consumed by TestComplete.  Probably the easiest way would be the "eval" of JavaScript or similar function.  But, as mentioned, that is still a step to convert that string into something TestComplete can use.  For that matter, you still haven't solved the problem of the application objects changing under development.  If the object hierarchy changes, if the class changes, etc., you still need to edit the Excel sheet at some point to match the change in the application.  There is no time save there.  

 

Editing object properties in NameMapping is actually very simple.  You don't need to remap things, just simply edit the property values and/or hierarchy.  Adding a new property, yeah, a bit more but again, no need to remap.  I don't see how it's any different than going into an XML or Excel file and editing the object strings there.

 

Also, using that naming convention, you lose the automatic "wait time" built in to TestComplete when looking for an object via NameMapping.  What happens when you perform an action and you need to wait for the object to be ready before you continue?  You'll still need to have some way of evaluating the object to be able to call something like WaitChild or WaitProperty. You lose any "flattening" of your objects... like, what you represented is a simple structure, but what about if there are other containers, etc., that your button lives in?  

 

Probably 6 one way, half a dozen the other, but regardless of how you go about building an object repository, you will still need to maintain it.  Again, I don't see any reason to reinvent the wheel and build your own when the tool has a valid feature built into it.

 

Just my opinion, really... if it works for you, it works for you... but that's why I don't think you're really helping yourself using something external. Some folks find it works, I just don't see how it is any better or worse.


Robert Martin
[Community Expert Group]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Extensions available
10 REPLIES 10
Community Hero

Re: How can we implement a keyword driven automation framework in test complete for Desktop applicat

Hi,

 

You can refer the below links for thinking of Keyword framework structure and flow.

http://www.guru99.com/keyword-driven-testing.html

http://toolsqa.com/selenium-webdriver/keyword-driven-framework/introduction/

 

Using test complete this will help you to get the coding http://blog.smartbear.com/software-quality/automation-framework-a-new-table-driven-technique-using-t...


Thanks
Shankar R

LinkedIn | CG-VAK Software | Bitbucket | shankarr.75@gmail.com

“You must expect great things from you, before you can do them”


Extension Available

Community Hero

Re: How can we implement a keyword driven automation framework in test complete for Desktop applicat

As the author of the smartbear blog link that @shankar_r posted, there's been a few updates to the framework since I originally wrote it.  I presented it in a SmartBear Academy 301 session back in October 2016 (video link https://support.smartbear.com/testcomplete/videos/smartbear-academy-testcomplete-301-training-q4/)

 

It is also available to access from my BitBucket account.  https://bitbucket.org/tristaanogre/tabledrivenframework/overview

 

Feel free to use it, adapt it, etc.  I do have a CCI License attached to it so, if you're going to use it, please make sure you attribute.


Robert Martin
[Community Expert Group]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Extensions available
Occasional Contributor

Re: How can we implement a keyword driven automation framework in test complete for Desktop applicat

Thanks for the reply guys.

 

What is the best way to use the objects in script.?

 

1. Store objects in some XML\Excel file as an object repository and read the objects in script and perform actions?

 

2. Store it in Name mapping file? This is little risky i feel when the application(want to automate) is in development state the control properties may keep changing. Every time I may have to change object properties in script?

 

In case of option 1, I just need to change objects in XML\Excel which is quite easy compared to option 2

 

Please let me know which would be a better approach.

Community Hero

Re: How can we implement a keyword driven automation framework in test complete for Desktop applicat

1. Store objects in some XML\Excel file as an object repository and read the objects in script and perform actions?

 

This is the common method most of the automation testers following, I think this has some has limitations like below,

 

  • You can't use the Extended Find[which is in-built option of Test Complete].
  • You may not be able to automate dynamic objects.
  • You can't descriptive programming.
  • I feel Maintenance would be nightmare if we use objects in Excel sheet. 

 

2. Store it in Name mapping file? This is little risky i feel when the application(want to automate) is in development state the control properties may keep changing. Every time I may have to change object properties in script?

 

  • All limitations in 1. can be done if you use Name mapping.
  • Usually, In scripts we will use only the property name not the property value hence if the object type changes then only we need to touch the script.
  • When it comes maintenance in objects then TC would be greatly assisted with the Namemapping with images[which is new feature of Test Complete], Advanced properties of an Object and etc,.

So overall, I would prefer Namemapping is the best option go!

 

I love be in the Automation framework development phase Smiley Happy but we already crossed that stage.

 

Anyways, Enjoy your coding on your new framework.


Thanks
Shankar R

LinkedIn | CG-VAK Software | Bitbucket | shankarr.75@gmail.com

“You must expect great things from you, before you can do them”


Extension Available

Community Hero

Re: How can we implement a keyword driven automation framework in test complete for Desktop applicat

As @shankar_r, if you use NameMapping properly and use properties that don't change as frequently, then you'll find very little you'll have to update when development changes the objects. Extended find helps when object hierarchy changes and, as noted, with the new image mapping in 12.30, some of this really gets cleaned up.  Updating NameMapping is not as hard as it sounds, it just takes a bit of awareness of what kinds of properties make for good mapping.

 

Storing objects in Excel and/or XML you would still need to translate them some way into TestComplete for it to recognize how to click on, key on, or other wise interact with the objects.  You'd probably end up having to use FindChild or FindAllChildren or similar functions which require you to utilize the same sorts of properties for searching as you would end up using in NameMapping anyways.  You would end up actually having to edit automation code where as using NameMapping, all your object identification factors are in one central location.

 

When it comes down to it, when your application objects change, you'll have to make a change SOMEWHERE.  So, since the tool provides the method, seems a bit cumbersome to write your own.  Others do it, but I find that using the native feature of the tool makes for less maintenance over all.


Robert Martin
[Community Expert Group]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Extensions available
Occasional Contributor

Re: How can we implement a keyword driven automation framework in test complete for Desktop applicat

Sorry Robert, why would I still need to translate them some way into TestComplete for it to recognize how to click on ?

 

I will store the Object details in Excel file and Read the object form the excel file in script and use the click function to perform an action 

 

like,  WPFObject("window").WPF("button").click()  ; Why would I need FindChild or FindAllChildren or similar functions, when I have unique object details stored in Excel and perform action in the script.

Community Hero

Re: How can we implement a keyword driven automation framework in test complete for Desktop applicat

hi,

 

You can't click a object with the string like WPFObject("window").WPF("button").click().

 

Still you have to evaluate the string in Test Complete in-order to click the Object.

 


Thanks
Shankar R

LinkedIn | CG-VAK Software | Bitbucket | shankarr.75@gmail.com

“You must expect great things from you, before you can do them”


Extension Available

Community Hero

Re: How can we implement a keyword driven automation framework in test complete for Desktop applicat

You still need to convert the string WPFObject("window").WPF("button").click() into objects and methods to be consumed by TestComplete.  Probably the easiest way would be the "eval" of JavaScript or similar function.  But, as mentioned, that is still a step to convert that string into something TestComplete can use.  For that matter, you still haven't solved the problem of the application objects changing under development.  If the object hierarchy changes, if the class changes, etc., you still need to edit the Excel sheet at some point to match the change in the application.  There is no time save there.  

 

Editing object properties in NameMapping is actually very simple.  You don't need to remap things, just simply edit the property values and/or hierarchy.  Adding a new property, yeah, a bit more but again, no need to remap.  I don't see how it's any different than going into an XML or Excel file and editing the object strings there.

 

Also, using that naming convention, you lose the automatic "wait time" built in to TestComplete when looking for an object via NameMapping.  What happens when you perform an action and you need to wait for the object to be ready before you continue?  You'll still need to have some way of evaluating the object to be able to call something like WaitChild or WaitProperty. You lose any "flattening" of your objects... like, what you represented is a simple structure, but what about if there are other containers, etc., that your button lives in?  

 

Probably 6 one way, half a dozen the other, but regardless of how you go about building an object repository, you will still need to maintain it.  Again, I don't see any reason to reinvent the wheel and build your own when the tool has a valid feature built into it.

 

Just my opinion, really... if it works for you, it works for you... but that's why I don't think you're really helping yourself using something external. Some folks find it works, I just don't see how it is any better or worse.


Robert Martin
[Community Expert Group]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Extensions available
Contributor

Re: How can we implement a keyword driven automation framework in test complete for Desktop applicat

Currently we have implemented Keyword driven framework and use separate excel for Object repository and separate excel for test case. In the test case we have 2 columns  the field (Which is coming from object repository) and valuea part from test condition, steps and expected result columns.

We like to use name mappping instead of object repository and like to know how we can pass the field column from test complete namemapping into the  testcase excel. is this approach possible?

New Here?
Join us and watch the welcome video:
Top Kudoed Authors