Sikuli RIDE combination: How to enable use of Sikuli functions? "global name 'exists' is not defined"

419 views
Skip to first unread message

David Scheele

unread,
Mar 24, 2015, 5:30:10 PM3/24/15
to robotframe...@googlegroups.com
Hi there,

I'm just getting started with Sikuli and RIDE. Sikuli seems to be the perfect approach for our purposes. After playing a round a bit I wrote a simple test script to get started. Mind that I have never before worked in python and am just learning as i go along.so I might just make a simple mistake and not know it.

Here is my simple script:

class ExampleLib:

   
def my_keyword(self):
       
"""does nothing"""
       
print("Yes mykeyword works for some reason")
       
pass

   
def your_keyword(self, arg):
       
"""Takes and Argument, does nothing"""
       
print("yourkeyword too... weird")
       
pass

   
def verifyApp(self):
       
if exists("1427206879174.png"):
           
print("yes!")
       
else:
           
print("no!")
       
pass

Now, in RIDE I can successfully import the lib and execute testcases with my_keyword and your_keyword. As expected, this is not rocket science.
But verifyApp wont fly. RIDE cant find "exists" and gives me:

<Date here> : FAIL : NamError: global name 'exists' is not defined

Is there a way to get this to work? Can't i just somehow import some sikuli library into RIDE?

Thanks for your help and time!

Best,
David 


ant...@gmail.com

unread,
Apr 8, 2015, 5:17:08 AM4/8/15
to robotframe...@googlegroups.com
By all means I'm not guru on the subject. I think that the solution to the riddle is:

1. your 2 first keywords are working because you just print something on the screeen. It doesn't matter if you pass arg or not.
2. verifyApp - it's problem with python syntax. To check if file exists you should use os module.

import os.path
if os.path.isfile(....)
   
print(....)



For more information check:


Kind Regards, Greg.

Wladislaw Wagner

unread,
Apr 8, 2015, 11:40:11 AM4/8/15
to ant...@gmail.com, robotframe...@googlegroups.com
Check out this Tutorial:


It's not about sikuli + ride in special but it shows u the concept of how sikuli can be used with RF. So if u get this u also will be able to use it with Ride. And actually u dont necessarily need Ride for this. You will See, I promise. I also started with ride but now I have all the stuff in 'IntelliJ Idea Community Edition' IDE. 

Cheers
Tset Noitamotua
--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-u...@googlegroups.com.
To post to this group, send email to robotframe...@googlegroups.com.
Visit this group at http://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages