question

pkamonar avatar image
pkamonar asked pkamonar posted

How do I macth the pattern with multiline and another line which has been different of value?

I have created my response map and found the problem that since I have triedto use  the pattern topology to match Vlan 1,10,30....1005 and the table topology to match Vlan 1,10 enet below.

But the result is to match only Vlan 1  (port Gi1/0/2 ->Te1/0/2)and then passed through to match the table below(Vlan 1,10 enet) at port column.

 

How do I can stop the mapping to drop at  "1005 trnet-default                    act/unsup"

 

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Gi1/0/2, Gi1/0/3, Gi1/0/4, Gi1/0/5, Gi1/0/6, Gi1/0/7, Gi1/0/8, Gi1/0/9
                                                Gi1/0/11, Gi1/0/12, Gi1/0/13, Gi1/0/14, Gi1/0/15, Gi1/0/16, Gi1/0/17
                                                Gi1/0/18, Gi1/0/19, Gi1/0/20, Gi1/0/21, Gi1/0/22, Gi1/0/23, Gi1/0/24
                                                Te1/0/1, Te1/0/2
10   VLAN0010                         active    Gi1/0/10
30   VLAN0030                         active   
1002 fddi-default                     act/unsup
1003 token-ring-default               act/unsup
1004 fddinet-default                  act/unsup
1005 trnet-default                    act/unsup

 

VLAN Type  SAID       MTU   Parent RingNo BridgeNo Stp  BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
1    enet  100001     1500  -      -      -        -    -        1002   1003
10   enet  100010     1500  -      -      -        -    -        0      0 

iTestresponse map
10 |950

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

pkamonar avatar image
pkamonar answered pkamonar posted

Hi PaulD,

 

This gave me helpful information! Thanks again.

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.

PaulD avatar image PaulD commented ·
Glad this was helpful.  Response mapping is, arguably, the most challenging area of iTest -- but once you develop the expertise, it can pay big dividends. 
0 Likes 0 ·
pkamonar avatar image
pkamonar answered pkamonar posted

Hi PaulD,

 

Thanks so much for the great suggestion and is it possible to give me some example like this?

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.

PaulD avatar image PaulD commented ·

I'm attaching two files.  The first is a test case.  The first step is an "eval puts" step that simulates your step that produces the multi-table response.  This step has an analysis rule that uses a regular expression to extract just the top table out of the response and stores it into a variable.  The next step is an "eval puts" step that dumps out just that table, so that we can apply a response map to it.  The second attachment is the response map file that will extract the data from that top table. 

 

Put both files into any iTest folder in your workspace.  Then run the test case and you'll be able to see the results.  If you select the second eval step, you'll see that all of the data is nicely "blue-boxed".

 

Let me know if there's anything you don't understand here.

0 Likes 0 ·
ramarb avatar image ramarb PaulD commented ·
That's your Midas touch, PaulD!
0 Likes 0 ·
pkamonar avatar image
pkamonar answered pkamonar posted

Hi ramarb ,

 

Thank you for your help..but it is still can not solve my problem because of the multiline at the first Port,it is not continue with the same line but it is up to the next line,so that's why I am trying to match them with pattern topology.

 

Please advise.

 

Thanks,

pkamonar

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.

PaulD avatar image PaulD commented ·

There is feature coming soon called "response filtering" that will be a big help here.  This feature will let you define a portion(s) of the response that you want to explicitly include or exclude in the final response to be analyzed.  In this case, you would be able to write a simple regex that would filter out everything other than the section you need, and then can use a simpler map to deal with just that portion.

 

In the meantime, I recall that dclaar elsewhere in the forum provided a very tricky way of dealing with a situation like this.  You can use a simple response map (pattern) that pulls out the section of the response you need and will store it in a variable, say var1.  Then on the next step, you can use "eval puts $var1" and can apply a response map to that step that operates only on the section that you need.  Effectively this does the response filtering "manually" that you need to deal with this kind of ugly situation.

 

Having said that, we've been talking for a while about creating an enhancement to our table mapper that can deal with these tables where one row in a table includes multiple lines -- as in this example you have here.  I think we should add that capability.  If we do, then the logic would try to detect the multiple lines per table row, and would concatenate the contents for each cell from all of the contents from the corresponding portions of those rows.  (Don't wait for it, though.  It might not be coming right away!)

 

Let me know if the solution suggested above seems daunting.  I might be able to put together an example for you.

0 Likes 0 ·
pkamonar avatar image
pkamonar answered pkamonar posted
Please see my response map for verification.

show_vlan12.ffrm (146.6 KiB)
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.

ramarb avatar image ramarb commented ·

I have seen a response something similar to this in the forum.. Please find it attached here.

Check if this helps to you. In this, they use one tabular map.

0 Likes 0 ·
show_vlan.ffrm (95.5 KiB)

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.