Forum Discussion

GAutomation's avatar
GAutomation
Frequent Contributor
5 years ago
Solved

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?

  • 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.

3 Replies

  • cunderw's avatar
    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.

  • tristaanogre's avatar
    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.

    • TanyaYatskovska's avatar
      TanyaYatskovska
      SmartBear Alumni (Retired)

      Thanks for your suggestions, tristaanogre, cunderw!

       

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