← Back to team overview

sikuli-driver team mailing list archive

[Bug 1215218] Re: [1.0.1] - Calling a script from another script using subprocess.

 

** Changed in: sikuli
       Status: In Progress => Confirmed

-- 
You received this bug notification because you are a member of Sikuli
Drivers, which is subscribed to Sikuli.
https://bugs.launchpad.net/bugs/1215218

Title:
  [1.0.1] - Calling a script from another script using subprocess ---
  workaround: use run()

Status in Sikuli:
  Confirmed

Bug description:
  I have tried to call a Sikuli script from within another script. For
  example I have the following standalone scripts:

  C:\SikuliX\Tests\testFlows\Scenario1.sikuli
  C:\SikuliX\Tests\testFlows\Scenario2.sikuli

  I want to perform the following:
  1. Start Scenario1 script.
  2. From within the Scenario1 I want to call Scenario2 and wait until it finishes.
  3. When Scenario2 is finished I want the Scenario1 script to continue from the next line.

  I have attempted to reach such functionality using in the following
  manner (from within Scenario1 script):

  import subprocess

  process = subprocess.Popen("c:\\SikuliX\\runScript.cmd -r C:\\SikuliX\\Tests\\testFlows\\Scenario2.sikuli", shell=True, stdout=subprocess.PIPE)
  process.wait()
  print process.returncode

  It seem to start running exactly as I have expected however after few
  steps it becomes stuck. It does recognize few patterns and type few
  symbols before it becomes stuck. However it always happen at the same
  point. It seems like it is stuck just before performing its first
  mouse click, but I'm not 100% sure.

  In addition, when I decide to terminate the process, I type Ctrl+C.
  When I do that, the mouse click(which was previously stuck) is
  performed the same moment and then (after one more Ctrl+C) the script
  finally exists.

To manage notifications about this bug go to:
https://bugs.launchpad.net/sikuli/+bug/1215218/+subscriptions


References