on ‎2020 Jan 22 10:49 PM
Scenario
I am able to trigger a javascript file from command line like this:
test1.js
application.openConnectionByConnectionString("conn=/H/10.10.10.100/S/3200&expert=true");
application.findById("/app/con[0]/ses[0]/wnd[0]/usr/txtRSYST-MANDT").text = "220";
application.findById("/app/con[0]/ses[0]/wnd[0]/usr/txtRSYST-MANDT").setFocus();
application.findById("/app/con[0]/ses[0]/wnd[0]/usr/txtRSYST-MANDT").caretPosition = 3;
application.findById("/app/con[0]/ses[0]/wnd[0]/usr/txtRSYST-BNAME").text = "username";
// The text of a password field is not recorded. Either enter a valid password or delete the following line
application.findById("/app/con[0]/ses[0]/wnd[0]/usr/pwdRSYST-BCODE").text = "secret";
application.findById("/app/con[0]/ses[0]/wnd[0]").resizeWorkingPane(181,35,false);
application.findById("/app/con[0]/ses[0]/wnd[0]").sendVKey(0);
application.findById("/app/con[0]/ses[0]/wnd[0]/tbar[0]/okcd").text = "/nex";
application.findById("/app/con[0]/ses[0]/wnd[0]").sendVKey(0);
#!/bin/bash
export SAPGUIDIR="/Applications/SAP Clients/SAPGUI 7.50rev5/SAPGUI 7.50rev5.app/Contents/Resources"
export WORKDIR=`pwd` # this is where the script file is located
cd "${SAPGUIDIR}"
echo "[DEBUG] starting..."
java \
-cp Java/GuiStartS.jar com.sap.platin.Gui \
-n \
-b \
-f ${WORKDIR}/test1.js
echo "[DEBUG] done!"
Problem
JavaGUI does not quit. There is a popup that says "The script has successfully completed its execution".
If I run the command again, I get another copy of JavaGUI running ...
How can I get JavaGUI to quit completely?
Please could anyone share a link to the full JavaScript API?
Request clarification before answering.
In case someone comes across this thread and that they're having issues with SAPGUI for Java 7.80:
application.unwrap(application).mUnattended = true;
java.lang.System.exit(0);
java -Djava.security.policy=file://...
grant principal com.sap.platin.micro.GuiPrincipal "SAPGUI:UserScript" {
permission java.io.FilePermission "<<ALL FILES>>", "read,write,delete,execute";
permission java.lang.RuntimePermission "getenv.*";
// Generic Permissions necessary for Scripting
permission javax.security.auth.AuthPermission "doAsPrivileged";
permission java.awt.AWTPermission "createRobot";
// Allow the script to exit
permission java.lang.RuntimePermission "exitVM";
};You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 6 | |
| 6 | |
| 6 | |
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.