App.open() not working on Windows Server 2012

Asked by pratik patil

Hi Team,

I already saw all threads regarding App.open() not working. Also i tried all possible solution to make it work on Windows Server 2012 but still I am not able to get it resolved.

I am getting error on screen as App.open failed: C:\Our\Product\Path not found.

However same code is working as expected on Windows 2007 Servers. I am not getting exact reason behind this problem.

On both servers same version of java installed.

Thanks for help.

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:

This question was reopened

Revision history for this message
RaiMan (raimund-hocke) said :
#1

same SikuliX versions?

might make sense, to try with version 1.1.1 (if it is not already used)

Revision history for this message
pratik patil (pratik24) said :
#2

Hey RaiMan,

All are in same version and that too 1.1.1.

Revision history for this message
RaiMan (raimund-hocke) said :
#3

please paste your App.open() exactly as used.

Revision history for this message
pratik patil (pratik24) said :
#4

We have SikuliActions class where all sikuli related actions being kept.

In that we have openApp() method where we are using - App.open(appPath); code to open Application.

appPath - C:/<app_path>

I also tried with double backslash and it did not resolve.

Revision history for this message
pratik patil (pratik24) said :
#5

public boolean openApp(String appPath) {
  Thread.sleep(2000);
  App.open(appPath);
  isExecuted = true;
  return isExecuted;
}

Revision history for this message
RaiMan (raimund-hocke) said :
#6

ok, misunderstood:
I want to see the offending path string ;-)

Revision history for this message
pratik patil (pratik24) said :
#7

This is what i tried so far -

1. C:/Program Files (x86)/<path>//xyz.exe
2. C:\Program Files (x86)\<path>\\xyz.exe
3. C:/Program Files (x86)/<path>/xyz.exe (This is working with 2007 server)

declared xyzPath at the beginning of script and then passing xyzPath while calling openApp(appPath).

Revision history for this message
pratik patil (pratik24) said :
#8

Sorry, it works as expected on 2008 Windows Server

Revision history for this message
RaiMan (raimund-hocke) said :
#9

ok, the intermediate blanks might be the problem:

please try:
xyzPath = r"C:\Program Files (x86)\<path>\xyz.exe"

Revision history for this message
pratik patil (pratik24) said :
#10

I tried with this option too ... but it is saying that

App not found r"C:\Program Files (x86)\<path>\xyz.exe"

Revision history for this message
TestMechanic (ndinev) said :
#11

Some ideas to try:

0. try working within Sikuli IDE
1. try using run() command
2. try runing another application - like Notepad - is it working?
3. try using pure jython

import os
os.system("app_to_run")

4. compose a .bat file that will start your app and then try to run the bat from sikuli command - run, open, etc..

Just wondering if this may be a permission promblem? Maybe you need elevated permissions...

Hope this helps

Revision history for this message
pratik patil (pratik24) said :
#12

Hi,

for 0 and 3, we have code written in Core java and framework already working smoothly. So we cannot use jython in our code.

1. Tried using App.run() but faced this error:
[error] RunTimeAPI: fatal error: java.io.IOException: Cannot run program "C:/Program Files (x86)/<path>/xyz.exe": CreateProcess error=740, The requested operation requires elevation

Also tried to append r at the beginning of path and still saw above error.

It seems like error of permission

2. Notepad++ application launched using App.run command

-I have checked notepad++.exe and xyz.exe security tab (permissions) and both are having same permission

do we have anything similar to os in java as you mentioned above ??

thanks for help till now ..

Revision history for this message
Manfred Hampl (m-hampl) said :
#13
Revision history for this message
pratik patil (pratik24) said :
#14

Yes ...

cmd /c <path in double quotes>

this worked well with App.run() as well as App.open()

Thank you all.

Revision history for this message
pratik patil (pratik24) said :
#15

Closing this as Issue is resolved.

Revision history for this message
pratik patil (pratik24) said :
#16

Hi,
I want to open this issue again ..

I am running my code in debug mode. Now App.run("cmd /c "<path>"") actually opening the application that I want but once it gets open I guess focus remains on that application and therefore debug pointer is not moving forward.

If I close the app then debug pointer moves to next step.

I am not understanding why this is happening.

In case of App.open(), application opened and debug pointer moved to next step.

Revision history for this message
pratik patil (pratik24) said :
#17

I can see that

run(command)
Run command in the command line

Parameters: command – a command that can be run from the command line.
This function executes the command and the script waits for its completion.

So if it waits for it completion then how I can proceed with the rest part of automation

Revision history for this message
Manfred Hampl (m-hampl) said :
#18

Have you tried app.open("...") instead of app.run("...")?

Revision history for this message
pratik patil (pratik24) said :
#19

Yes I tried that too ...

App.open() opens command prompt as well as our application and then debug pointer moves to next step

App.run() opens our application but debug pointer does not move to next step.

Revision history for this message
RaiMan (raimund-hocke) said :
#20

open() comes back immediately after having triggered the app opening.

run() waits for completion of the given command or command file. In your case it will only come back, after the app is closed again. To avoid this effect with the run(), you have to use commands, that detach the command processing and immediately come back.
An example for a command that does this: start

Can you help with this problem?

Provide an answer of your own, or ask pratik patil for more information if necessary.

To post a message you must log in.