We are building a new experience for our SmartBear Community.
This site is now read-only. You can still browse and search as usual. Learn More
This site is now read-only. You can still browse and search as usual. Learn More
https://msdn.microsoft.com/en-us/library/d5fk67ky(v=vs.84).aspx by default does not wait for the command to complete, so Log.Warning(Sys.Clipboard) happens before diff completes. To make it wait you need to specify True as the third parameter of the Run method.
WshShell.Run(diffCmd, 0, True)
Alternatively, you can use Python's built-in https://docs.python.org/3/library/subprocess.html#subprocess.check_output so you won't have to deal with the clipboard:
import subprocess
def diffTwoFilesToLog(file1, file2):
output = subprocess.check_output(["C:\\Program Files (x86)\\GnuWin32\\bin\\diff.exe", file1, file2])
output = output.decode() # convert byte-string to string
Log.Warning(output)
https://msdn.microsoft.com/en-us/library/d5fk67ky(v=vs.84).aspx by default does not wait for the command to complete, so Log.Warning(Sys.Clipboard) happens before diff completes. To make it wait you need to specify True as the third parameter of the Run method.
WshShell.Run(diffCmd, 0, True)
Alternatively, you can use Python's built-in https://docs.python.org/3/library/subprocess.html#subprocess.check_output so you won't have to deal with the clipboard:
import subprocess
def diffTwoFilesToLog(file1, file2):
output = subprocess.check_output(["C:\\Program Files (x86)\\GnuWin32\\bin\\diff.exe", file1, file2])
output = output.decode() # convert byte-string to string
Log.Warning(output)
HKosova John_LairdThanks for sharing nice info.