question

amanan avatar image
amanan asked ericnute edited

Unexpected responses

Hi all,

 

How do I detect unexpected responses from commands sent to the DUT?  The correct response is only the echo() with no further lines of text (normal Cisco cli).  How can I detect that any additional lines of text appear before the next prompt?

iTestresponse mapanalysis rule
10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
PaulD avatar image
PaulD answered PaulD posted

Welcome to the forum, amanan!

 

You don't need response mapping to do this.  You can simply add a rule to any step where you want to check to see if its response is non-empty.  To do this, it is probably easiest to use a "contains" rule.  To check to see if you get anything other than whitespace, you can use Regex and look for \S (which means "any non-whitespace character").  Because we perform substitutions on the contains body, you need to escape the backslash, so it becomes \\S.

 

Then you can adjust the When True/When False actions as you want.

 

I'm attaching a simple test case that shows how to do this.  You could copy this analysis rule to any step where you'd like to check for non-empty.

 

Let me know if you want a more detailed explanation of what is going on.

 

 


1 comment
10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

amanan avatar image amanan commented ·

Thanks Paul,

 

This solution works!!

 

Art

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.