question

Kumar_K avatar image
Kumar_K asked Yaseen answered

How to change the media type from copper to fiber in an xml

I have hundreds of xml files where I need to change the media type from copper to fiber. How do I do that without loading the xml file in the STC application. say via notepad++.
Spirent TestCenter (STC)xmlmedia type
10 |950

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

Yaseen avatar image
Yaseen answered
In order to change the media Type for individual port we may need to modify the code in the script. Attached is the modified script, that would modify the port media type based the port location being passed for the variable pLoc, 1. If pLoc is empty i.e., "", then the script would modify all the ports in the configuration 2. If pLoc is specified as //10.10.10.10/1/1, then the script would modify the port that has the location as //10.10.10.10/1/1 Hope it helps! Thanks! [link text][1] [1]: /storage/temp/4094-convertcoppertofiberportbased.tcl

10 |950

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

Yaseen avatar image
Yaseen answered
I suggest to use the Tcl API commands to achieve this with the below steps, 1. Load the existing xml file in offline mode 2. Change the Media Type on ports 3. Save the modified configuration in xml Attached is sample Tcl script to achieve the same. Note: We need to have Spirent TestCenter automation setup in the local machine to achieve this. Hope this helps! Thanks! [link text][1] [1]: /storage/temp/4093-convertcoppertofiber.tcl

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.

Kumar_K avatar image Kumar_K commented ·
Thanks Yaseen. Suppose I have two ports configured in the xml file and I need to change only one of the port to fiber, then how do I do it?
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.