Forum Discussion

han's avatar
han
Contributor
14 years ago

Log.Link to bat file with parameters

Shouldn't it be possible to use Log.Link to run a bat file with parameters?



What is wrong with this code?



Log.Link """C:\test.bat"" test", "Not Working"

Log.Link "C:\test.bat test", "Not Working"

Log.Link "C:\test.bat", "Working"

Log.Link "C:\Windows\system32\cmd.exe", "Working"

5 Replies

  • Hi,



    This behavior is normal. A link posted by Log.Link should contain a valid full path to the needed file. Parameters in the link are not supported.
  • han's avatar
    han
    Contributor
    My idea was to report all differences as warnings then to have two Log.Link with PASSED/FAILED.

    The PASSED link would run a bat file that updated the compare image so that the next time the difference would be in the "reference" picture and the test would pass.

    The FAILED link would run a bat file that reported the the difference as a bug.



    This would be possible if the log.link was able to use the "link" the same way as the windows run.



    Is there a reason that the Log.Link doesn't work in the same way as the windows run?
  • Hi,



    Why don't you generate the needed BAT files at the end of your test? In this case, there will be no necessity to pass params to that files (you can write the needed info right in the file). You can use the aqFile.WriteToTextFile method. See the "aqFile.WriteToTextFile" help topic.
  • han's avatar
    han
    Contributor
    Yes that would be the "ugly" solution.



    But with about 2000 bitmap image compare there is the possibility to have to create 4000 bat files containing almost the same code :-)



    Is there any reasone why it's not possible to have a "long" link that will be executed in the same way as windows run?



    I could think of other times when it would be nice to have this option e.g. start our "tested app" with an URL as parameter to show the failed application directly from the log.


  • Hi,



    why it's not possible to have a "long" link that will be executed in the same way as windows run


    We have an appropriate suggestion in our DB, and your message has increased its rating.