question

mallikarjunarao avatar image
mallikarjunarao asked mbarfield answered

How to make multiline response into single line

Hello,

I have a response pattern that spans into multiple lines, i need make it as single line to accommodate other response map.

I need to convert below multi line response pattern into single line, I have tried using Response Filters didn't worked for me.

 Detailed Oper Status            : Provisioning mismatch, the Payload Size is 
                                 : probably different from remote 
                                 : channel            

I need to convert like this

 Detailed Oper Status            : Provisioning mismatch, the Payload Size is probably different from remote channel           

Here is my response map looks like

interface xxx
 Description			 :
 Detailed Oper Status            : Provisioning mismatch, the Payload Size is 
                                 : probably different from remote 
                                 : channel    

Thanks

Mallitestresponsemap.txt

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

1 Answer

·
mbarfield avatar image
mbarfield answered

Mali, you can have the response map team fix this by using custom queries or you can handle this in the test case with xpath assuming it's response mapped. I created a simple script and response map that shows the lines combined.

I used the xpath concat function to accomplish this task.

Example: concat(.//Detailed_Oper_Status1, .//Detailed_Oper_Status2, .//Detailed_Oper_Status3)

More about the concat function here:

http://www.w3schools.com/xpath/xpath_functions.asp

Attached is a simple example - combinemultiplelines.zip


10 |950

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

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.