sikuli-driver team mailing list archive
-
sikuli-driver team
-
Mailing list archive
-
Message #07480
[Question #181202]: App.open() won't throw exception?
New question #181202 on Sikuli:
https://answers.launchpad.net/sikuli/+question/181202
I'm trying to right some code that will launch firefox on windows machines. On 64-bit windows, the path to firefox is "C:\Program Files (x86)\Mozilla Firefox\firefox.exe", but on 32-bit windows it's "C:\Program Files\Mozilla Firefox\firefox.exe" (different names for 'Program Files' directory).
So I wrote something like this:
path32 = "C:\\Program Files\\Mozilla Firefox\\firefox.exe"
path64 = "C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe"
try:
App.open(path32)
except:
App.open(path64)
When I run this on a 64-bit machine, sikuli reports an error when it attempts the try statement:
[error] App.open failed: C:\Program Files\Mozilla Firefox\firefox.exe not found.
However, it skips straight over the except statement and continues as if nothing had happened. Am I doing something wrong here? I'm sure I could use another approach to check the path before attempting to open, but it seems as if this approach should work as well.
Thank you for your time,
Paul
--
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.