cancel
Showing results for 
Search instead for 
Did you mean: 

Hierarchy Change Check

SOLVED
Occasional Contributor

Hierarchy Change Check

Hello!

I'm wondering if there is a tool is or function that would allow test complete to compare the object Hierarchy of a process against a previous build of a process. Or how to make a keyword test that can do that.

Consider this scenario: A new build is made for the desktop application that I am testing. I want to be able to quickly check whether changes were made in the application that could effect the test scripts. Such as a button being moved or the name of a drop-down menu item being changed. Is there a way to check whether the object Hierarchy of a process has changed?

I'm looking at the Process Action Operations and it seems like there should be a way to do this. Maybe get the child count of the process and compare it to child count of the previous build? Maybe compare the dump file of the new build against a dump file of the previous build? Compare screen shots of the object browser?

Any thoughts would be appreciated!

 

 

 

 

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Community Manager

Re: Hierarchy Change Check

Hi @kahle,

 

Could you please check if the Object Snapshots feature works for you? You can find more information here:

https://support.smartbear.com/testcomplete/docs/testing-with/exploring-apps/object-browser/snapshots...

 

 

---------
Tanya Gorbunova
SmartBear Community Manager

 Join SmartBear Connect next April in Boston to meet with software development, API and testing experts from around the world! Get your ticket today!

View solution in original post

Highlighted
Community Leader

Re: Hierarchy Change Check

Hello,

 

You can always use this solution:

 

function compareObject() {
  var obj = Sys.Process("notepad++");
  var FileName = "C:\\work\\ObjectInfo.txt"; // the path to the file the snapshot is saved to
  var SaveRecursive = true; // properties of the object's child objects are saved as well.
  var SaveAllProperties = true;
  var AdditionalProperties = "The file contains the snapshot of an object that corresponds to notepad++";
  var SaveFields = true;
  var SaveMethods = true;
  
  // Saves the snapshot
  aqObject.SaveObjectSnapshotToFile(obj, FileName, SaveRecursive, SaveAllProperties, AdditionalProperties, SaveFields, SaveMethods);
  let xml = aqFile.OpenTextFile("C:\\work\\ObjectInfo.txt", aqFile.faRead, aqFile.ctANSI);
  let result = aqFile.Compare("C:\\work\\ObjectInfo.txt", "C:\\work\\ObjectInfo2.txt")
}

the default object returned from SaveObjectSnapshotToFile its an .xml saved with .txt extension so to be more specific You can always parse this .xml into .json and Log differences in Test Log results.

View solution in original post

8 REPLIES 8
Highlighted
Community Leader

Re: Hierarchy Change Check

What comes to my mind is that when you are on an object in an actively used process you can search for all the subordinate elements of the active element and compare them with e.g. those you have entered in the NameMapping repository (or decode the .xml file nameMapping to the object and search for these elements).

The only question is whether this is a good path for testing.


Remember that even if you implement such a solution, you will be able to get away with a lot of feedback (and there will be a lot of it)


Usually, the application is tested in regression tests and new functionalities that need to be added are obtained in test scenarios that we program for example scripts

 

Consider this thought because you are repairing yourself by writing such a solution and the benefits may be inadequate for the job.

Highlighted
Community Manager

Re: Hierarchy Change Check

Hi @kahle,

 

Could you please check if the Object Snapshots feature works for you? You can find more information here:

https://support.smartbear.com/testcomplete/docs/testing-with/exploring-apps/object-browser/snapshots...

 

 

---------
Tanya Gorbunova
SmartBear Community Manager

 Join SmartBear Connect next April in Boston to meet with software development, API and testing experts from around the world! Get your ticket today!

View solution in original post

Highlighted
Community Manager

Re: Hierarchy Change Check

Thank you Wamboo, Tanya! 

Hi @kahle , were you able to figure out an approach to solve this? Did any of the suggestions help? Please let us know.  



Sonya Mihaljova
Community and Education Specialist

 Join SmartBear Connect next April in Boston to meet with software development, API and testing experts from around the world! Get your ticket today!
Highlighted
Occasional Contributor

Re: Hierarchy Change Check

Hey,

 

The object snapshot really seems like it would work! Is there a way to compare two object snapshots? It seems like the file.compare method only applies to .txt files.

 

 

Highlighted
Community Manager

Re: Hierarchy Change Check

@kahle Glad to hear that you seem to be on the right track.

@Wamboo @cunderw @Marsha_R , do you have any suggestions on comparing object snapshops? Thank you!



Sonya Mihaljova
Community and Education Specialist

 Join SmartBear Connect next April in Boston to meet with software development, API and testing experts from around the world! Get your ticket today!
Highlighted
Community Leader

Re: Hierarchy Change Check

Hello,

 

You can always use this solution:

 

function compareObject() {
  var obj = Sys.Process("notepad++");
  var FileName = "C:\\work\\ObjectInfo.txt"; // the path to the file the snapshot is saved to
  var SaveRecursive = true; // properties of the object's child objects are saved as well.
  var SaveAllProperties = true;
  var AdditionalProperties = "The file contains the snapshot of an object that corresponds to notepad++";
  var SaveFields = true;
  var SaveMethods = true;
  
  // Saves the snapshot
  aqObject.SaveObjectSnapshotToFile(obj, FileName, SaveRecursive, SaveAllProperties, AdditionalProperties, SaveFields, SaveMethods);
  let xml = aqFile.OpenTextFile("C:\\work\\ObjectInfo.txt", aqFile.faRead, aqFile.ctANSI);
  let result = aqFile.Compare("C:\\work\\ObjectInfo.txt", "C:\\work\\ObjectInfo2.txt")
}

the default object returned from SaveObjectSnapshotToFile its an .xml saved with .txt extension so to be more specific You can always parse this .xml into .json and Log differences in Test Log results.

View solution in original post

Highlighted
Community Manager

Re: Hierarchy Change Check

Thanks Wamboo!

 

@kahle It seems like you are all set nowSmiley Happy Did you give it a go?

 

 



Sonya Mihaljova
Community and Education Specialist

 Join SmartBear Connect next April in Boston to meet with software development, API and testing experts from around the world! Get your ticket today!
Highlighted
Occasional Contributor

Re: Hierarchy Change Check

Hello,

 

Really sorry I did not respond to this sooner. So I was able to modfiy and run the example script and perfrom an object comparison!

 

This is a great starting point.

 

Thank you very much for the example script!