Ask a Question

Exception running keyword test when called from another test

Joberry
Occasional Contributor

Exception running keyword test when called from another test

The automated testing sratergy we are embarking on is to record/handcrank simple Keyword tests (Units scripts when enhanced logic is required), large tests result in a large number of called keywords and scripts with normal while/if logic to contol which keywords are called.

 

This has been working well up untill today, when a test failed with an Exception (No additional info/help), the called test ran well on its own, but continued to fail when called,

 

The only solution I found was to copy the Test statements into the previous keyword test called (It was simply clicking on a button - now it clicks on the button and does stuff)

 

The stuff copied was not even very complex, a simple CTRL + D keypress and CTRL + S and close two windows.

 

This has lent me to thinking is there a limit to the number of keyword tests that can be called? (I personally would prefer to script everything, but I have been tasked to make it simple - hence record simple keywords - and then I stitch it all together and add the complex logic)

 

Todays issue has made me nervous as there was no clear reason for the error and the solution seems to show a weakness in our startergy (No limit to number of keywords appears in any documention, the only limitation I have found is one of Functionality, i.e why I would prefer to script)

 

9 REPLIES 9
tristaanogre
Esteemed Contributor

Theoretically speaking, you are correct.  There's no limit to how "deep" your keyword test calls can be.  But, as with anything dealing with computer software, the limitations MAY be outside of the tool. If you consider call stack, you could have a memory limitation of how much memory is consumed if your keyword test calls are too deep.


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)

Hi @Joberry,

 

It's a great question. Thanks for bringing it up here.

Let me involve more community leaders in this topic so that they could share their thoughts on the testing strategy. @AlexKaras@Marsha_R@Wamboo@LinoTadros@cunderw, anything to add?

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



Joberry
Occasional Contributor

I have now converted all the Keyword tests to Scripts (I am happier with scripts anyway!), I have raised a support ticket to ask this question more formally.

#00427087: "Tests work until one more Keyword test is called then Test stops with Exception."

I did look at Perfmon trace during the failed execution (Memory and CPU showed benine usage), The call stack showed 4 rows, so not eaxctly huge.

m_essaid
Valued Contributor

Hi,

What is the exception ?

You could surround your script with some "try/catch" or "try/except" blocks, and then get the exception message

  try
    your code here
  except
    Log.Message('an exception has been raised : ' + exceptionmessage);
  end;

What happens if you move that failing test somewhere else in the list?  Does it always fail on that one test or does it always fail on whatever the last test is?


Marsha_R
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
sonya_m
SmartBear Alumni (Retired)

Thank you for active participation everyone!

 

@Joberry any luck with solving this?

 

 I found the support ticket you mentioned. It looks like the Support Team is waiting on some information from you there. Please keep us posted on the results of the investigationSmiley Happy


Sonya Mihaljova
Community and Education Specialist

sonya_m
SmartBear Alumni (Retired)

@Joberry , any updates? 


Sonya Mihaljova
Community and Education Specialist

Joberry
Occasional Contributor

I have abandoned using Keywrod tests and converted everything to script, it all works now...  There was NO information within the exception, The stack was not big (4 layers), System CPU/Memmory was not maxed, it did litterally appear to be the addition of one more keyword script, if the body of the keyword was moved to the calling keyword, it was happy, if I added one more it failed again.....I have to be honest, I was not entirely happy using keywords, but was forced don that route, scripting is allowing me to perform much better application flow control ...

sonya_m
SmartBear Alumni (Retired)

I see. Thanks for sharing your results with us.  

For some users, it’s easier to create tests by using the KDT feature, others like the flexibility that scripting provides. If you feel like scripting does the trick for you, this is great!Smiley Happy 


Sonya Mihaljova
Community and Education Specialist

cancel
Showing results for 
Search instead for 
Did you mean: