Contributions
Re: XML Checkpoint
rraghvaniAny way I can update the below to show in the log the differences if found? FunctionCompareFiles(fileName1, fileName2) Dimfso, file1, file2, regEx DimfileText1, fileText2, newText1, newText2 ConstForReading = 1 ' Creates the FileSystemObject object Setfso = CreateObject("Scripting.FileSystemObject") ' Reads the first text file Setfile1 = fso.OpenTextFile(fileName1, ForReading) fileText1 = file1.ReadAll file1.Close ' Reads the second text file Setfile2 = fso.OpenTextFile(fileName2, ForReading) fileText2 = file2.ReadAll file2.Close ' Creates the regular expression object SetregEx =NewRegExp ' Specifies the pattern for the date/time mask ' MM/DD/YYYY HH:MM:SSLL (for example: 4/25/2006 10:51:35AM) regEx.Pattern = "\d{1,2}.\d{1,2}.\d{2,4}\s\d{1,2}:\d{2}:\d{2}\w{2}" regEx.IgnoreCase =True regEx.Global =True ' Replaces the text matching the specified date/time format with <ignore> newText1 = regEx.Replace(fileText1, "<ignore>") newText2 = regEx.Replace(fileText2, "<ignore>") ' Compares the text CompareFiles = (newText1 = newText2) End Function SubMain DimfileName1, fileName2 fileName1 = "d:\text1.txt" fileName2 = "d:\text2.txt" IfCompareFiles(fileName1, fileName2)Then Log.Message("The files are equal") Else Log.Error("The files are different") End If End Sub241Views0likes0Comments- 265Views0likes0Comments
XML Checkpoint
Hi , I would like to do something similar tohttps://support.smartbear.com/testcomplete/docs/testing-with/checkpoints/files/comparing-with-variable-parts.htmlbut for XML File Comparisons? I would like to use regexp to ignore some of the stuff in the XML comparison? Is this doable ? Thanks, shahidSolved297Views0likes5Comments- 161Views0likes0Comments
TestComplete aqPerformance
For the below script, in the Log.Message section, how do i enter string in to it to display a messsage like " The calculationstook" +aq.Performance.Value() )? I get a run time error when trying above SubgetTime() ' Start a time counter aqPerformance.Start() ' Do some actions ' Log the elapsed time, in ms Log.Message(aqPerformance.Value) EndSubSolved180Views0likes2Comments- 1.8KViews0likes0Comments