question

fvalpondi avatar image
fvalpondi asked cwhitty answered

Analyse Rule for an Empty Response

Hello,

 

I am trying to analyse some responses from a switch. Some of the commands that I have to analyze do not return any answer on success. If the command is incorrect, I get an error message.

 

I tried to do an analysis rule for an "empty answer", but I did not succeed....

 

Any idea on how I can do that?

 

thanks a lot!!

 

iTest
10 |950

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

mallikarjunarao avatar image
mallikarjunarao answered mallikarjunarao posted

 

Hello,

 

Use golbal analysis rule to session profile, then it will check entire your testcase.

 

My team lead Mike Barfield, he suggest to use this scenario to check when an error occured in telnet session, Thanks Mike.

 

GolablAnalysisRules.png


10 |950

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

mallikarjunarao avatar image
mallikarjunarao answered mallikarjunarao posted

fabio,

 

i think your getting error message due to query failure on your testscript,

 

QueryFail.png

 

 

uncheck check box Declare issue if no matches found.

 

Please let me know if i misunderstood your question.

 

Thanks

Malli


QueryFail.png (19.3 KiB)
2 comments
10 |950

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

fvalpondi avatar image fvalpondi commented ·

It is not exactly what you say. If I uncheck the box, any non matching response will be bypassed.

0 Likes 0 ·
mallikarjunarao avatar image mallikarjunarao fvalpondi commented ·

fabio,

 

Try this example

 

CommandDoen'tReturnResponse.png

 

In the example I tried with Linux change directory command, if directory changed successfully the command executed successfully, if it fails, something return on to the screen. The result of the command stored into a variable called "res", make sure enable checkbox "Store only the text of the response" in step properties otherwise it stores all the response on the console..

 

Then I compare with regular expression, the regular expression say if any character or number found in the res variable, then command execution was failed else command executed successfully.

 

I hope this could solve your problem.

 

Thanks

Malli

0 Likes 0 ·
JeffJ avatar image
JeffJ answered JeffJ posted

If you're just looking to get rid of the error, there's a switch in the map that basically says "Don't error if there's no response".  If you can give me more information on the type of map and what exactly you're after, I can give you more details.

5 comments
10 |950

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

fvalpondi avatar image fvalpondi commented ·

Hi Jeff,

 

thanks for your answer.

 

Well, the response of the device is easy. I just wanted to use "Response includes..." rule.

 

If the command is correct, it is as follows:

switch(config-if-vlan1)#ip address 192.168.50.1 255.255.255.0

switch(config-if-vlan1)#

 

If the command is not correct, it is as follows:

switch(config-if-vlan1)#ip address 192.168.50.255 255.255.255.0

% Invalid IpAddress and SubnetMask

switch(config-if-vlan1)#



Since it is a positive test, I do not want to test for the error message, but for the successful exectution of the command. I just want to get an OK if no message is issued after the command, and a FAIL if the failure message is issued.

 

I thought I could do it with negative logics, that means: If NOT (Error Message) then (OK). But the problem in this case, is that other messages can appear.

 

thanks a lot for your help!

0 Likes 0 ·
msandeep avatar image msandeep fvalpondi commented ·

Hi,

 

If you use analysis rule with contains as shown in below screenshot you can achieve your requrement.

'

I have added an analysis rule that if response contains "Error message" test should fail else the test will pass(if response contains any other messages also test will pass).

 

Please try this and let me know how it helps!!

 

Thanks,

 

0 Likes 0 ·
analysis.JPG (29.8 KiB)
fvalpondi avatar image fvalpondi msandeep commented ·

Hi msandeep,

 

thanks for your comment.

Anyway, the example you put is the one I told I was not considering, since it only looks for that error message. If any other status/error message appears it will be considered as passed.

 

thanks again.

0 Likes 0 ·
koelze avatar image koelze fvalpondi commented ·

I haven't tried this, so I'm not sure it works, but..could you possibly store the response of that step in a variable, and then take a step to analyze the length of the response string?  You can check the length of a string using the "string length $stringName" command in an eval action.

0 Likes 0 ·
fvalpondi avatar image fvalpondi koelze commented ·

Hi Kevin,

 

thanks for the idea! It sounds good. I'll try it!

 

regards,

Fabio

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.