To verify all objects and all properties in a Dialog or a Page
In QTP/UFT, how do you verify all the objects and their properties in a Dialog or a Page?
(Running in Maintenance Mode will only check for one object)
In SilkTest, you can use .GetEverything () and .VerifyEverything () functions.
.GetEverything () will capture all the objects in a given Windows Dialog or a Page including all the objects properties.
.VerifyEverything () will verify all the objects and objects properties captured by .GetEverything (). The results will tell you if the object's Caption has changed, if the Style has changed from Normal to Italics, plus all the remaining properties of the object -- for all the objects in one statement.
Kind of handy functions/methods to have when you wanted to quickly check if any of the objects in a Dialog or Page has changed since the last build/version of the AUT.
(especially when no Release Notes or Documentation provided with the Release to QA)
Thanks for your input.
A Page Checkpoint would probably achieve a similar thing for a webpage.
... just another Tester ...
That's a good question, I was also thinking of something similar.
That's a good question, I was also thinking of something similar.
We can get all object properties and values of all the objects displayed on a page or a dialog using descriptive programming, once we have the run-time object properties and their values we should be able to compare it with the properties and their values we have in OR.
Simple implementation could be .. have an excel with objects and their unique properties and their values and later compare this excel with objects properties and their values retrieved during runtime. May be you can have this script run initially before executing any other scripts.
Just a thought have not implemented myself yet, if it works let me know or if anybody has some other thoughts, please share.
Thanks and Regards.
Are we talking ALL objects on a dialog/page or just those you are interacting/verifying (or are in the OR for that page/dialog).
If you are talking all objects that could be 1000's of objects (depending on your page content) each with a number of properties, and dynamic pages may amplify that.
Yes, that's what the SilkTest functions GetEverything() and VerifyEverything() do.
How many times have we heard developers saying "We did not change anything" or "We only change this thing" and then later on you find out that there are changes made that they did not tell you.
When you use these functions, it helps you quickly see the differences between the previous run/version and the current version of the AUT. The results have all the differences hightlighted and most of the time, the test will fail due to: version number change, date/time displayed, etc. and right away you'll be able to tell if the rest of your tests are affected by these changes. Simple tests that can easily be added to your Screen Navigation tests or even Smoke Tests.
Tried for simple desktop application, it worked fine was able to check for displayed object properties and values with the ones I had stored.
This can .. .. .. In a way reduce a lot of debugging and time effort that may be involved if we have to execute the entire test set and later realize so and so scripts have failed because of some object property and value mismatch.
Idea is good may help reduce some burden on automation engineers and may help engineers to identify the object property mismatch issues upfront.
If I can, will give it a try for web based apps and get back. If you guys have any other thoughts please share.
Thanks and Regards
That's good news, Prashin2QTP.
Originally Posted by Prashin2QTP
When you have your function(s) ready for others to try, please share. Maybe your function(s) are better than the ones SilkTest has. Again in the SilkTest function GetEverything(), it will get you all the objects and their properties (everything) that the tool can see/recognize on a page/screen and VerifyEverything() will verify all objects and properties in the current page of AUT. New objects seen/recognized are included in the results too.
Maybe your version of VerifyEverything() has option where you can eliminate/ignore objects that are not of interest or that you already know will not affect your other tests such as any Date/Time elements that we know will change anyway or the version number that changes from build to build.
Hope you finish your functions soon so we can see how they work!
This was something which i was thinking for few days, and after seeing your post it just made me think further. Usually we go through this debug and fixing object property mismatches most of the time.. blah blah blah .. i know .. .. .. you would be knowing it already, so will just share what i did, just to see whether it works or not ..
Created a following description object
Set obj = Description.Create()
ob("micClass").value = "[^Static].*"
Set cobj = Window("property:=Value").childobjects(obj)
and then looped through each child object under parent window. Once i got hold of each child object getting any property and its value was not a problem.
We can either opt to have all property values retrieved from the child object or just the mandatory properties which one may require to identify that particular object.
One can baseline all object properties and values in an excel or some other place and later one can just compare the latest property and its value with the base lined properties and values. I used excel to have these properties and value stored.
Imported the excel and then compared it with the ones displayed at the moment.
Script execution time was not that bad, finding the defects earlier definitely saves time, money etc., .. .. .. guess same applies here as well. Rather than waiting for entire regression cycle to get over to know the cause of failure hopefully one can know it bit earlier.
Same approach was thinking of using it for simple web applications.
Let me know your thoughts.
Thanks and Regards,
My thoughts on this is that these GetEverything() and VerifyEverything() functions provided in SilkTest helped me out quite a bit to identify in the early going what tests are affected by the changes made by the Dev team. The test results highlight the differences clearly in different color for mismatches so they were easy to point out to the developers. All of these are built-in functions in SilkTest.
For the data you are storing in Excel, that can be really huge. If there are 15 properties for a PushButton, for example, like Style (Bold, Italic, Normal), disabled (0 or 1), etc. or the list of items in a List or ComboBox, that can be a lot of rows in Excel.
Wouldn't it be nice if HP can add these as built-in functions in UFT?
Originally Posted by Gilbert
Yes, indeed it would be great if there are built-in functions for this.
Was thinking from the perspective of how using QTP/UFT one can implement this as of now, and how it can add some value in terms of saving time and money.
Understand if one has to compare with each property and value for each test object, excel(in this case) would be huge.
In the mean time till HP thinks of implementing some built-in functions for this, was thinking of possible approach to resolve this scenario.
Its definitely a very good thought Gilbert, if some built-in functions are available for this.
If you think of other approach to resolve this for the time being please let us know.