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

Bug #1215218 reported by Eugene S
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SikuliX
Confirmed
Medium
Unassigned

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.

RaiMan (raimund-hocke)
Changed in sikuli:
importance: Undecided → Medium
milestone: none → 1.1.0
status: New → In Progress
RaiMan (raimund-hocke)
Changed in sikuli:
milestone: 1.1.0 → 1.2.0
RaiMan (raimund-hocke)
Changed in sikuli:
status: In Progress → Confirmed
RaiMan (raimund-hocke)
summary: - [1.0.1] - Calling a script from another script using subprocess.
+ [1.0.1] - Calling a script from another script using subprocess
Changed in sikuli:
milestone: 2.0.0 → none
summary: - [1.0.1] - Calling a script from another script using subprocess
+ [1.0.1] - Calling a script from another script using subprocess ---
+ workaround: use run()
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.