sikuli-driver team mailing list archive
-
sikuli-driver team
-
Mailing list archive
-
Message #46858
[Bug 1762381] Re: [1.1.2] App.open() is not returning the instance --- docs have to be adjusted
** Summary changed:
- [1.1.2] App.open() is not returning the instance --- workaround
+ [1.1.2] App.open() is not returning the instance --- docs have to be adjusted
** Changed in: sikuli
Status: In Progress => Fix Committed
** Description changed:
- ------------------ workaround
- use
- App app = new App("C:\\Program Files (x86)\\Microsoft Office\\root\\Office16\\EXCEL.EXE").open();
+ ------------------ usage information
+ In case the given program name or path to program contains blanks, the complete string has to be enclosed in extra apostrophes:
+
+ App app = App().open("\"C:\\Program Files (x86)\\Microsoft Office\\root\\Office16\\EXCEL.EXE\"");
+
+ An appropriate hint has to be added to the docs.
-----------------------------------------------
App.open() method call does not return the instance of the opened
application instead it always return null whether application open
successfully or not.
method is "private App openAndWait(int waitTime)". Because of "notFound"
variable is false it returns null. But "appPID" is greater than 0.
sikulixapi - 1.1.1 version
OS - 64 bit windows 10
How to reproduce.
App app = App.open("C:\\Program Files (x86)\\Microsoft
Office\\root\\Office16\\EXCEL.EXE");
this will return null but excel will be opened successfully.
Method location in App.java class
private App openAndWait(int waitTime) {
if (isImmediate) {
appPID = _osUtil.open(appNameGiven);
} else {
AppEntry appEntry = makeAppEntry();
init(_osUtil.open(appEntry));
}
if (appPID < 0) {
Debug.error("App.open failed: " + appNameGiven + " not found");
notFound = true;
} else {
Debug.action("App.open " + this.toStringShort());
}
if (isImmediate && notFound) {
return null;
}
if (waitTime > 0) {
if (!isRunning(waitTime)) {
return null;
}
}
return this;
}
Always execute this line.
if (isImmediate && notFound) {
return null;
}
--
You received this bug notification because you are a member of Sikuli
Drivers, which is subscribed to Sikuli.
https://bugs.launchpad.net/bugs/1762381
Title:
[1.1.2] App.open() is not returning the instance --- docs have to be
adjusted
Status in Sikuli:
Fix Committed
Bug description:
------------------ usage information
In case the given program name or path to program contains blanks, the complete string has to be enclosed in extra apostrophes:
App app = App().open("\"C:\\Program Files (x86)\\Microsoft Office\\root\\Office16\\EXCEL.EXE\"");
An appropriate hint has to be added to the docs.
-----------------------------------------------
App.open() method call does not return the instance of the opened
application instead it always return null whether application open
successfully or not.
method is "private App openAndWait(int waitTime)". Because of
"notFound" variable is false it returns null. But "appPID" is greater
than 0.
sikulixapi - 1.1.1 version
OS - 64 bit windows 10
How to reproduce.
App app = App.open("C:\\Program Files (x86)\\Microsoft
Office\\root\\Office16\\EXCEL.EXE");
this will return null but excel will be opened successfully.
Method location in App.java class
private App openAndWait(int waitTime) {
if (isImmediate) {
appPID = _osUtil.open(appNameGiven);
} else {
AppEntry appEntry = makeAppEntry();
init(_osUtil.open(appEntry));
}
if (appPID < 0) {
Debug.error("App.open failed: " + appNameGiven + " not found");
notFound = true;
} else {
Debug.action("App.open " + this.toStringShort());
}
if (isImmediate && notFound) {
return null;
}
if (waitTime > 0) {
if (!isRunning(waitTime)) {
return null;
}
}
return this;
}
Always execute this line.
if (isImmediate && notFound) {
return null;
}
To manage notifications about this bug go to:
https://bugs.launchpad.net/sikuli/+bug/1762381/+subscriptions
References