Forum Discussion
It is possible to compare two files, see Compare Files Operation
Hi, could you please share the code with me? I want to compare two large json files which also has a dynamic value which is the machine IP. This will keep changing as per the CDM deployments. So could you please suggest as to how to handle such json files using testcomplete and VBs. Aslo, if you could share a code for reference?
- AlexKaras2 years agoChampion Level 3
Hi,
'Comparison' might mean different expected results that you did not mention...
Plain file comparison will indicate whether or not files match as text or binary ones.
You may use, for example, regular expressions (supported by VBScript) to replace irrelevant dynamic data with generic placeholders (for example, replace all ip addresses with '<ip>' string) and then compare files as text ones.
VBScript does not support JSONs. If you really need to work with JSON, you may consider script extension created using JScript which supports work with JSON and call this extension from your VBScript test code (see help for more info on script extensions in TestComplete).
Related Content
- 13 years ago
- 5 months ago
Recent Discussions
- 14 hours ago
- 2 days ago