Mojave : SikuliXIDE : Simple example needed to integrate SikuliX script into RobotFramework

Asked by Melvin Raymond

It feels like I'm going down a really big rabbit hole here that will take me hours and hours to figure out. I know how to create a SikuliX Script to click an image, as I've done this a couple years ago on earlier versions of Sikuli. But, what do I need to do to get something as simple as that to work from the Robot Framework? Is this easy to do, or is it a lot more complicated to set things up for this? Can I get an example to try out? I want to stay in the SikulixIDE with the Robot Framework.

- Using Mac Mojave
- Using Python 2.7.10
- Java SE 8
- Using SikulixIDE-1.1.4-SNAPSHOT (looks like I need to get latest download, and will do that soon)
- I'm running a Desktop Application on the Mac Mojave platform.

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
Melvin Raymond
Solved:
Last query:
Last reply:
Revision history for this message
Melvin Raymond (fribian) said :
#1

OK, I think I answered this myself. I guess a simple click in a "def" statement does work when called from the Robot Framework. This is what I used from an existing script. I just and I watched it physically click in the area I had recorded.

  def stop_my_application(self, lqApp):
    click("1551130276080.png")

That number you see in the ".png" converted when I pasted it in here but it was the screenshot of a text field I had used. So for now I can continue to play around with more. I'll close this as self answered.

Revision history for this message
Melvin Raymond (fribian) said :
#2

OK, I think I answered this myself. I guess a simple click in a "def" statement does work when called from the Robot Framework. This is what I used from an existing script. I just and I watched it physically click in the area I had recorded.

  def stop_my_application(self, lqApp):
    click("1551130276080.png")

That number you see in the ".png" converted when I pasted it in here but it was the screenshot of a text field I had used. So for now I can continue to play around with more. I'll close this as self answered.

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

Yes, seems you got it:

The implementation of the SikuliX features is done in the attached class inside the functions representing the keywords used in the RFW source.

BTW:
- Using Python 2.7.10
not relevant in your situation, since SikuliX needs Jython 2.7 (which you downloaded, when getting the IDE)

One more thing:
Already looked at???
https://github.com/rainmanwy/robotframework-SikuliLibrary
has many SikuliX features implemented already as useable keywords (but does not work in the IDE!)

Revision history for this message
Melvin Raymond (fribian) said :
#4

Cool! Thanks RaiMan for the feedback again. Just that "Click(<yadda
yadda>)" a long way. Looks like SikuliX works a lot better than the older
version I used a few years ago. I'm having fun playing with this. Wish I
had more time. I did look at those SikuliX features implemented but once I
saw they didn't work in the IDE, I kinda backed away from it. That's where
I got the "rabbit hole" feeling.

On Tue, Feb 26, 2019 at 1:28 AM RaiMan <email address hidden>
wrote:

> Your question #678788 on Sikuli changed:
> https://answers.launchpad.net/sikuli/+question/678788
>
> RaiMan posted a new comment:
> Yes, seems you got it:
>
> The implementation of the SikuliX features is done in the attached class
> inside the functions representing the keywords used in the RFW source.
>
> BTW:
> - Using Python 2.7.10
> not relevant in your situation, since SikuliX needs Jython 2.7 (which you
> downloaded, when getting the IDE)
>
> One more thing:
> Already looked at???
> https://github.com/rainmanwy/robotframework-SikuliLibrary
> has many SikuliX features implemented already as useable keywords (but
> does not work in the IDE!)
>
> --
> You received this question notification because you asked the question.
>

--
Mel Raymond - Quality Assurance Engineer
<email address hidden>

Vernier Software & Technology

13979 SW Millikan Way

Beaverton, OR 97005

www.vernier.com

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

I fully understand your "rabbit whole" feeling ;-)

To use RFW as such alone is some challenge (because it has another approach than simple scripting).

Using it together with SikuliX is again some way up the hill of perception.

So congrats, that you now see some light at the end of the rabbit whole ;-)

Revision history for this message
Ryan (ryan-g2) said :
#6

Melvin - I know the feeling. I had to re script everything basically to convert my Sikuli script into something that would work from RF. I had to re-think who was in the driver seat of the script - it moved from sikuli to RF.

I basically had to turn everything Sikuli did into various functions and call them from RF. I also had to start passing variables back and forth from RF to Sikuli, since Sikuli was no longer driving and couldn't pass things between itself.

And then there was the learning of the syntax of RF...

Revision history for this message
Melvin Raymond (fribian) said :
#7

I have now gotten a retrofit Framework that I can use to start automating any Desktop application I wanted to at this point. A lot of our stuff is already automated by another person who's VERY good... top notch automation using his own framework. So for me, it's learning some new stuff for fun right now, but I might actually use some of it at some point. We'll see how it goes. I know there's potential to do a lot more with this if one had the time. I love the output it generates through the Robot Framework. I can log things in such a way that it allows me to see where the problems are. Like you I have to think things through differently. But, also I am completely new to Python, and have no Java programming skills at all. I've programmed in C++ but it's been a long time. So it was quite a bit to soak in. I did automate some with the older version of Sikuli.