@@ -288,22 +288,29 @@ def Run(self, FileName, WorkingDir="", Flag="") :
288288
289289 This is required in order to do error code translation into exceptions for Robot Framework.
290290 """
291+ #
292+ # Capture the PID of the launched process and return
293+ #
294+ application_pid = None
291295 self ._infoKW (self .Run , FileName , WorkingDir , Flag )
292296
293297 if WorkingDir == "" and Flag == "" :
294298 cmd = "FileName='%s'" % FileName
295- self ._AutoIt .Run (FileName )
299+ application_pid = self ._AutoIt .Run (FileName )
296300 elif WorkingDir != "" and Flag == "" :
297301 cmd = "FileName='%s', WorkingDir='%s'" % (FileName , WorkingDir )
298- self ._AutoIt .Run (FileName , WorkingDir )
302+ application_pid = self ._AutoIt .Run (FileName , WorkingDir )
299303 else :
300304 cmd = "FileName='%s', WorkingDir='%s', Flag='%s'" % (FileName , WorkingDir , Flag )
301- self ._AutoIt .Run (FileName , WorkingDir , Flag )
305+ application_pid = self ._AutoIt .Run (FileName , WorkingDir , Flag )
302306 #
303307 # Check the AutoIt error property
308+ # If no error then return the PID of the launched application
304309 #
305310 if self ._AutoIt .error == 1 :
306311 raise Exception ("Failed to run %s" % cmd )
312+ else :
313+ return application_pid
307314 #
308315 #-------------------------------------------------------------------------------
309316 #
0 commit comments