Ask a Question

How to log the results if Waitaliaschild method returns object does not have a child

SOLVED
GAutomation
Frequent Contributor

How to log the results if Waitaliaschild method returns object does not have a child

We are having a separate function to log the results in a different location in mht file format. Converted all our project to use name mapping.

 

Some times it fails at

w-=aliases.legaclt.wndLSPANEL3.page32770.waitAliasChild('Button1",3000)

exists neither returns true or false but it returns aliases.legaclt.wndLSPANEL3.page32770 objesct does not have a child with the name " Button1"

 

when the script run for 10 lines and on 11 line if it fails due to above issue a log is not generated with our function. I can see test complete generate the logs. For now we are manually exporting that logs and storing in the results folder. but is there a way to ahndle this?

3 REPLIES 3
cunderw
Community Hero

This will throw an exception, so unless you have logs being exported in the GeneralEvents_OnStopTest event handler it will never get called.

 

You could try to catch the exception as well so the test engine isn't stopped.

 

IMO though this should never be a case you run into while running tests. All tests and scripts should be reviewed by someone before being put in a regression or formally running test suite.


Thanks,
Carson

Click the Accept as Solution button if my answer has helped
tristaanogre
Esteemed Contributor

WaitAliasChild requires that the parent object (in your example, page32770) has a child object in the Alias tree named Button1.  This is a NameMapping configuration item... WaitAliasChild will not just wait for any child object, it needs to SPECIFICALLY be a NamedMapped object with the indicated name.  This is a coding problem with someone not understanding the nature of the method being used.


Robert Martin
[Hall of Fame]
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
Vegas Thrill Rider
Extensions available
TanyaYatskovska
SmartBear Alumni (Retired)

Thanks for your suggestions, tristaanogre, cunderw!

 

@GAutomation, did the suggestions help you? Please mark the best answer as a solution.

---------
Tanya Yatskovskaya
SmartBear Community and Education Manager



cancel
Showing results for 
Search instead for 
Did you mean: