Beyond Compare with QTP/VBScript



Scooter's software Beyond Compare with QTP/VBScript:


Public WorkingFolder = "C:\Test"


Public BeyondComparePath = "C:\Program Files\BC3\Beyond Compare 3\BCompare.exe"



Public Function CompareFiles(LeftFile, RightFile, ReportName, ComparisonType)

         CreateBeyondCompareScript
         Set oShell = CreateObject("Wscript.Shell")
         'Select Different Comparasion Type Script
         If LCase(ComparisonType) = "text" Then
                  BeyondCompareScriptPath = WorkingFolder & "BC_Text.txt"
         Else
                  BeyondCompareScriptPath = WorkingFolder & "BC_Data.txt"
         End If

GenerateReportCommand = """" & BeyondComparePath & """ @""" & BeyondCompareScriptPath & """ """ & LeftFile & """ """ & RightFile & """ """ & ReportName & """" & " /closescript /silent"
QuickCompareCommand = """" & BeyondComparePath & """ /qc """ & LeftFile & """ """ & RightFile & """"

'Run to generate Report
oShell.Run GenerateReportCommand, 3, True

'Run to get Exit Code
iErrCode = oShell.Run(QuickCompareCommand, 3, True)
CompareFiles = iErrCode

End Function




Function CreateBeyondCompareScript()

            If Not (oFSO.FileExists(WorkingFolder & "BC_Data.txt")) Then
               Set oFile = oFSO.CreateTextFile(WorkingFolder & "BC_Data.txt", True)
               oFile.WriteLine "data-report layout:InterLeaved &"
               oFile.WriteLine "options:ignore-unimportant,display-all &"
               oFile.WriteLine "output-to:%3 output-options:html-color &"
               oFile.WriteLine "%1 %2"
            End If

           If Not (oFSO.FileExists(WorkingFolder & "BC_Text.txt")) Then
                Set oFile = oFSO.CreateTextFile(WorkingFolder & "BC_Text.txt", True)
                 oFile.WriteLine "text-report layout:InterLeaved &"
                 oFile.WriteLine "options:ignore-unimportant,display-all &"
                 oFile.WriteLine "output-to:%3 output-options:html-color &"
                oFile.WriteLine "%1 %2"
           End If

End Function

ReturnCode = CompareFiles(ProcessedDataSorceFileName, ProcessedFeedFileName, “Report.html”, “data”)

Return code can return below values (from BC help):


0 Success

1 Binary Same

2 Rules-Based Same

11 Binary Difference

12 Similar

13 Rules-Based Difference

14 Conflicts Detected

100 Unknown error

101 Conflicts Detected. Merge output not written.


Comments

  1. Anonymous18/6/13

    Κeep on working, gгeat job!

    Take а look at my blog post - stock options training
    **

    ReplyDelete
  2. Anonymous18/6/13

    Wonderful blog! I found it while browsing on
    Yahoo News. Do you have any suggestions on how to get listed in Yahoo News?
    I've been trying for a while but I never seem to get there! Thanks

    My weblog Going At this website

    ReplyDelete
  3. Anonymous6/6/14

    Hello there I am so thrilled I found your website, I really
    found you by accident, while I was researching on Askjeeve for something else, Regardless
    I am here now and would just like to say cheers for a
    marvelous post and a all round thrilling blog (I also love the theme/design), I don’t have time to look over it all at
    the moment but I have saved it and also included your RSS
    feeds, so when I have time I will be back to read much more, Please do keep up the excellent jo.


    Also visit my weblog ... avis consommateur remuneree

    ReplyDelete
  4. Anonymous18/6/14

    Very nice write-up. I certainly appreciate tis website.

    Keepp writing!

    My web page ... First DUI Law Firm Norristown

    ReplyDelete
  5. Anonymous19/7/14

    I don't know if it's just me or if perhaps everybody else experiencing problems with
    your blog. It appears as if some of the text in your
    content are running off the screen. Can someone else please comment and
    let me know if this is happening to them as well?
    This could be a problem with my web browser because I've
    had this happen before. Thank you

    Feel free to visit my webpage :: boudoir photography in chicago

    ReplyDelete
  6. Beyond Compare 4.2.4 Crack is the most recent useful and Multifunctional system that is being applied to take care of your files and files. Beyond Compare 4.2.4 Crack You may also handle files and files by connecting with other computer systems in a speedy manner. It offers the result after Synchronization in details that enables

    ReplyDelete

Post a Comment

Popular posts from this blog

Software Testing @ Microsoft

Trim / Remove spaces in Xpath?