How can I create and run SikuliX scripts on MacOS? - macos

I'm trying to use Sikuli on MacOS to do some automation. I've downloaded the SikuliX IDE 2.0.4 from here, and Jython 2.7.2 from here, and put the two of them in the same directory as per instructions in the docs.
I'm running MacOS Catalina 10.15.7 and this is the Java version:
java version "1.8.0_281"
Java(TM) SE Runtime Environment (build 1.8.0_281-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.281-b09, mixed mode)
I'm able to open the SikuliX IDE, however when I click on the "Take Screenshot" button all applications are minimized, including the ones I want to take a screenshot of, and that happens even if I open the application that I want to automate and use the SikuliX IDE shortcut to take a screenshot.
When this happens only the SikuliX menu bar, background and docker are visible. And even then, if I try to take a screenshot of a icon in the docker the image that opens up on the SikuliX IDE contains only the background, as if the docker is transparent.
I tried to take a screenshot using MacOS's default tools, but in this case when I try to run an instruction as simple as click() the script crashes.
This is the output of an attempt to click on the Finder icon in the docker:
[error] script [ create_new_folder ] stopped with error in line 1
[error] FindFailed ( finder_icon.png: (86x78) in R[0,0 1680x1050]#S(0) )
[error] --- Traceback --- error source first
line: module ( function ) statement
1: main ( <module> ) click("finder_icon.png")
[error] --- Traceback --- end --------------
I wasn't able to find much stuff about SikuliX on MacOS. Any suggestions on how I might be able to take screenshots and automate things on MacOS with SikuliX?

Reason behind: in the standard macOS now blocks taking screenshots.
Solution: This has to be allowed in the Prefs -> Security&Privacy -> Privacy -> ScreenRecording.

Related

Godot export crash

I am new to godot engine and have started working on a project(i am using gdscript)...
When I run the project as test it works fine(like in the godot engine), but when I export it, it shows the godot logo and then crashes...
This is my godot file system
godot file system
This is the message i am getting in the debug console
error message in debug menu
platform/windows/os_windows.cpp:2905 - Condition "ret == 0" is true. Returned: ERR_CANT_FORK
Please help I have worked hard on this project and if I cant export all that is for nothing
I'm going to transcribe the error image you linked for you:
platform/windows/os_windows_cpp:2905 - Condition "ret == 0" is true. Returned: ERR_CANT_FORK
editor/editor_export.h:251 - Resources Modification: Could not start rcedit executable. Configure rcedit path in the Editor Settings (Export -> Windows -> Rcedit)
Emphasis:
Configure rcedit path in the Editor Settings (Export -> Windows -> Rcedit)
ERR_CANT_FORK means it could not fork start a new process. Which process?
Could not start rcedit executable
If we search Rcedit on Godot's official documentation the following article shows up: Changing application icon for Windows. It says:
Before selecting it in the export options, you will need to install an extra tool called rcedit. You can download it here.
After downloading, you need to tell Godot the path to the rcedit executable on your computer. Go to Editor → Editor Settings → Export → Windows. Click on the folder icon for the rcedit entry. Navigate to and select the rcedit executable.
To reiterate: Configure Rcedit.

How to use the OpenEdge debugger (OpenEdge Debugger 11.6)

I'm working with OpenEdge Progress-4GL AppBuilder and Procedure Editor, and now I'd like to start working with the OpenEdge Debugger, release 11.6.
As found on quite some places on the internet, I've taken following actions to enable debugging of my Progress application:
Using Proenv, I've launched following command:
prodebugenable -enable-all
I get following response:
OpenEdge Release 11.6 as of Fri Oct 16 19:01:51 EDT 2015
==============================================================================
PROGRESS Debug Enabler
==============================================================================
Debugging is enabled for the Progress 4GL installed in
C:\PROGRE~1\OpenEdge.
For your information, some information on environment variables:
proenv>set DLC
DLC=C:\PROGRE~1\OpenEdge
proenv>set WRK
WRKDIR=C:\OPENED~1\WRK
proenv>set ENABLE_OPENEDGE_DEBUGGER
Environment variable ENABLE_OPENEDGE_DEBUGGER not defined
As far as my application is concerned, the application is based on a shortcut, which looks as follows:
C:\Progressx86\OpenEdge\bin\prowin32.exe
-basekey "INI"
-ininame c:\progress\our_application\progress.ini
-pf c:\progress\our_application\misc\run_our_application.pf
-p our_application.r
-rr
The file "run_our_application.pf" contains a list of entries, like the following:
-db our_DB
-H DC1
-N tcp
-S 6543
To the mentioned shortcut, I've added -debugReady 5001 in order to enable debugging, based on TCP portnumber 5001. When I launch the application, I get a warning message about this, and netstat -aon gives me following entry:
TCP 0.0.0.0:5001 0.0.0.0:0 LISTENING 11344
Where 11344 is confirmed as the prowin32 application.
In OpenEdge debugger, I've following entries in menu item "Edit", "Preferences", "Attachable":
C:\progress\our_application
Z:\Progress\our_application\PRG
C:\Progressx86\OpenEdge
For your information: The Z:-drive is an external server drive, Z:\Progress\our_application\PRG is the directory where files (*.w and *.p) get compiled into *.r files, the file our_application.r can be found there.
Nevertheless, when I open a *.w file and I go to the menu "Debug", the "Attach to Process" menu item stays disabled.
What can I do in order to debug my application/*.w file?
There are several ways of debugging. Start simple. You should be able to use any of the following:
from the procedure editor
Instead of selecting [ Compile / Run ], select [ Compile / Debug ]. The AVM will start executing the current file and the debugger will suspend execution on the first line.
from any alert-box
Add -debugalert to your startup parameters and every alert-box will display an additional 'Help' button. Clicking on it will show the stack-trace and a 'Debug' button. Clicking on that will start the debugger, execution is suspended at the line of the alert-box, this can be your own alert-box or an error.
stand-alone debugger
Start the debugger application (the Windows shortcut starts proDebugger.bat) and select [ Debug / Attach To Process... ] you can then either enter a PID or select a local running session (AVM).
remote attachable debugger
This is what you seem to be trying to setup - this allows you to attach the stand alone debugger (see option 3) to a process running on another machine, this can be useful when you have an AppServer or WebSpeed agent that you want to debug.
PDSOE debugger
Not relevant for you since you are not using Progress Developer Studio for OpenEdge, but just mentioning it for completeness. This allows adding break points in your source code by double clicking in the left margin and stepping through your source code instead stepping through a debug-listing.

Xcode Instruments gives this error "Could not start script, target application is not frontmost."

I am using Xcode version 5.0 and trying to use instruments,when i am running the script which contains "var target = UIATarget.localTarget();"
the following error appears :" Could not start script, target application is not frontmost."
It's known issue:
The message “Could Not Start Script : Target app is not frontmost” may be displayed when attempting to capture a UI Automation script in Instruments against the iOS 7 Simulator.
If this occurs, close the trace document and create a new one. 15387075
Source: Xcode 5.0.2 Release notes

Why won't Firefox trace to flashlog.txt in Ubuntu?

Okay me and my friend are about to tear our hair out trying to configure the Adobe Flex SDK to work properly on our Ubuntu machine. We have installed and configured the SDK to compile ActionScript files but the FlashPlayer Debugger fails to log traces or errors to flashlog.txt when we execute the compiled swf in Firefox.
We have Flash Player Debugger installed into Firefox and a mm.cfg file located in our home directory.
Links to what we've tried:
http://www.arulraj.net/2010/08/flash-player-debugger-in-ubuntu.html
http://www.gregoryprogrammer.com/2012/12/actionscript-3-code-compilation-in-inux/
http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7fc9.html
http://helpx.adobe.com/flash-player/kb/configure-debugger-version-flash-player.html
Versions of what we're using:
Firefox Browser 18.0.2
Ubuntu OS 12.0.4
Latest Flex SDK
I notice you didn't mention compiling with the -debug flag. Here're the steps I take:
Make sure you're using the debug version of the player (hit flashplayerversion.com to check). This is getting trickier in-browser, especially in 64-bit Linux. Firefox is probably easier than Chrome these days. You can also try the debug content projector (aka standalone player) located here.
Have a ~/mm.cfg file with TraceOutputFileEnable=1. Here's mine:
> cat ~/mm.cfg
ErrorReportingEnable=1
TraceOutputFileEnable=1
Use the trace method somewhere you know it will be executed:
> cat Main.as
package {
import flash.display.Sprite;
public class Main extends Sprite {
public function Main() {
trace("Hello flashlog.txt");
}
}
}
Compile the SWF with the -debug option:
mxmlc -debug Main.as
I'll test with the content projector:
>flashplayerdebugger Main.swf &
>tail ~/.macromedia/Flash_Player/Logs/flashlog.txt
Hello flashlog.txt
Or open a dedicated terminal to follow the log file as it is written:
>tail -f ~/.macromedia/Flash_Player/Logs/flashlog.txt

Custom debug command in Visual Studio using a Makefile project

I have a Makefile-powered project in Visual Studio 2010 (uses NAnt, in fact, but that's beside the point).
The output of the build process is a .elf file, and I have a separate, non-VStudio debugger which can be run on that .elf file to debug it.
Building works fine, but when I click the 'debug' button (little green triangle), VStudio fails with "Unable to start program 'XXX.elf'. The specified file is an unrecognized or unsupported binary format"
I'm guessing VStudio is just trying to 'run' the .elf as though it were an .exe, and failing.
What I really want VStudio to do is run "my_debugger.exe XXX.elf" when I press the debug button.
I have tried adding a file association with .elf=>my_debugger.exe
I have updated PATHEXT appropriately as well, and run VStudio under those changes.
Still no luck.
Isn't there somewhere in VStudio where you can specify a custom debug command? I thought there was, but can't find it.
I could just have the build process output a .bat file or something I guess, but this seems silly.
As Jim mentioned you can specify which app to start on run in the project settings (Command field). If you place a debugger there you can pass down your executable as an argument to the debugger being launched (Command Arguments field). This way you can launch the debugger which in turn will launch your executable if the debugger expects any commandline arguments.
MinGW on Windows example:
Command: gdb.exe; Command Arguments: Path\ToMyApp\whatever.exe
will start gdb.exe, gdb.exe will open whatever.exe, parse the debug info and wait for debug instructions.
Command: msys.exe; Command Arguments: gdb.exe Path\ToMyApp\whatever.exe
will start msys.exe, msys.exe will execute "gdb.exe Path\ToMyApp\whatever.exe"
Look at the project properties. Do you have a Debug tab which has a Start Action section giving three choices? Those choices would be: ( ) Start project, (x) Start external program: ... ( ) Start browser with URL.
You can also set the command line arguments and working directory.
Cf. How to: Change the Start Action for Application Debugging

Resources