Printer FriendlyEmail Article Link

iTest: How to replace a content on multiple lines in a XML file?

Environment/Versions

iTest

Answer

 

To replace a content  in a XML file, we could use a tcl command "regsub". It replaces the old string with new string character.

Kindly follow the steps:

readfile -> XML file -> Step properties -> Store Response -> var1. This must be followed by the regsub command.

Syntax: regsub -all old_string $var1 new_string var1

Please go through the sample attachment for your reference.

 

Attachments
Attachment
Attachment Description
Sample test case for using the regsub command


Product : iTest Enterprise