SikuliX-2014
SikuliX-2014 copied to clipboard
Error in App.open failed: C:/Program not found on Windows Machine
On Windows machine program/process will be in C:/Program Files (x86)/.... The absolute path could have space in between. The windows implementation of OSUtil class which is WinUtil class is causing issue since it is taking the full process same in a single string, & later separating the parameters with space separator logic.
I would suggest for taking the process/program name separately while creating the App object.
[debug] RunTimeAPI: loadLib: WinUtil.dll [debug] WinUtil.getApp: C:/Program Files (x86)/Cisco/Cisco AnyConnect Secure Mobility Client/vpnui.exe [debug] App.create: [-1:C:/Program] true [debug] WinUtil.getApp: C:/Program false [debug] WinUtil.getApp: C:/Program [debug] WinUtil.getApp: 10504 [error] App.open failed: C:/Program not found [debug] highlight R[139,395 433x394]@S(0)[0,0 1920x1080] E:Y, T:3.0 for 2.0 secs app.isValid() => false app.window() => null app.isRunning() => false app.getName() => C:/Program [debug] RunTimeAPI: final cleanup [debug] FileManager: deleteFileOrFolder:
Does this work?
App('"C:/Program Files (x86)/Cisco/Cisco AnyConnect Secure Mobility Client/vpnui.exe"')
This is how I start my app:
import subprocess
subprocess.Popen(["C:\\Program Files\\Internet Explorer\\iexplore.exe", "http://my.URL.under.test/"])
You should be able to use:
t = App.open('"C:\\Program Files\\Internet Explorer\\iexplore.exe" http://my.URL.under.test/')
I think the general rule is "if it works on the command line, it should work with App.open()". In this case, put double quotes around the path/executable name so it's recognized as a single token.
I have to check. App should interpret the given string or even list/array of strings as Python's subprocess.Popen does it.