2010-07-21

What is the best tree model for web in TestComplete

This question is often ask, when people start to automate web applications.You know, TestComplete offers 4 models in 7.x version:
  • DOM
  • Tag
  • Hybrid
  • Tree
But what is the best?

And here is my observations:

The DOM and Hybrid are not useful at all - I did see any applications (saw at more that 10 of web applications) in which it could be useful. The selection is between Tag and Tree.

Tag is good when there are a lot of intermediate DIV's in application, e.g. as it is for applications build on GWT (Google Web Toolkit). In such case it allows to simplify path to the elements.
Tree is good when there is a tree :). Seriously! E.g. if there are a lot of places where you want to know the children of the parent node.

According to performance, I know the cases when the Tag is faster and the cases when the Tree is faster. Do not believe to anyone, just test.

BTW, there is a verbose description in TestComplete help regarding tree models. You can read it in TestComplete help (Menu "Help"->"Index", type "Tree model (Web testing), About", press ). I will not display it here, because it a lot of text and I believe that you have already read about this :). I show you something more interesting - the personal view about what the fastest tree model from AutomatedQA support team:

The fastest web tree model is the Tree model as stated in the "Web Tree Models" ( http://www.automatedqa.com/support/viewarticle.aspx?aid=5541 ) help topic, so I recommend that you use it. Also, I recommend that you only call the Refresh or RefreshMappingInfo method (the method you use depends on whether you use name mapping in your tests) only for the object whose child objects should be refreshed. So, if only a panel is supposed to be refreshed, you should call the method for this panel or the panel's parent, not for the entire Page object and not for the Sys object (calling the method for the Sys object makes TestComplete refresh the entire object tree).

Also, I recommend that you see the following article:

http://www.automatedqa.com/techpapers/testcomplete/test-playback-performance-tips/
I will not judge you if you read this advices with a little of skepticism, but I agree that calling Sys.Refresh or SomePage.Refresh is not sexy.

Actually we come the following solution - use Tag model by default and switch at runtime to Tree model, where in makes sense. Yes, you can switch at runtime by writing:
Options.Web.TreeModel = "Tag";

It will be interesting for me to try mirror case: use Tree by default and switch to Tag in some cases.

What is your experience with usage of web tree models in TestComplete or in other test automation tools?

No comments:

Post a Comment