[Sikuli-driver] [Question #232998]: Eclipse and Sikuli IDE are inconsistent in some places

2013-07-25 Thread Parn Yin
New question #232998 on Sikuli:
https://answers.launchpad.net/sikuli/+question/232998

My automation testing project plan contains 2 parts:

(1) use Eclipse + PyDev + Sikuli Libs to develop automation script;

(2) use Sikuli IDE 
(a) to check the screenshots when develping
(b) to run the automation test


The reason is:

(1)  Eclipse has everything to make professional, well structured, well 
documented and debuggable stuff. Just like RaiMan said in 
https://answers.launchpad.net/sikuli/+question/231799 ;)

(2a) Eclipse can't capture or check the screenshots. I really like and need the 
"Pattern Settings" function in Sikuli IDE, especially when the "Similarity" or 
"Target Offset" is needed.

(2b) When running automation test, different machines need to install/configure 
the environment. The easier the install/configure is, the less problems we will 
get.

==

But now I encounter a problem.
To make the project well structured, I created several sub-folders for it.

--Module
--login
--login1.py
--login2.py
--set
--log.py
--startend.py
--dossier  # one of my company's software's name
--...
--...
--...
--TestCase
--TestCase1.py
--TestCase2.py
--...
--Screenshot
--Documentation

I've added the "Module" 's path to Eclipse's PYTHONPATH, and at the beginning 
of the startend.py, there are:

# Import Sikuli library
from sikuli import *
# Import other modules of PurkinjeLibraries
from set.log import *

so when I ran startend.py in Eclipse, it worked.
However, when I tried to open them in Sikuli IDE, I found that Sikuli IDE can 
only open sikuli source file(*.sikuli)...

So I change the hierarchy of "set" to:

--Module
--set
--log.sikuli
--log.py
--startend.sikuli
--startend.py

Then Sikuli IDE could display the startend.py by opening the startend.sikuli.
However, when running, it told me that it couldn't find the module "set.log".
I know that Sikuli can find other *.sikuli in the same folder, so I changed the 
line
from 
from set.log import *
to
from log import *
However, when I went back to Eclipse, Eclise tole me that it couldn't find the 
module "log"...

So I added the "set" 's path to Eclipse's PYTHONPATH...
It worked but according to the structure, if using this way,
- I have lots of paths need to be added into PYTHONPATH;
- I have to added a folder of *.sikuli for each *.py to make them can be opened 
in Sikuli IDE.

Is there a easier way to fix this "inconsistent" problem?

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


[Sikuli-driver] [Question #232999]: Read the word from the flex web page and click on that

2013-07-25 Thread Divesh Pathak
New question #232999 on Sikuli:
https://answers.launchpad.net/sikuli/+question/232999

Hi 

I want to read the content from a flex web page and click on that using Sikuli.
I am using java as a language,
 my code will be like this

Screen s = new Screen();
s.click("click me");

for some of the word it's working fine but most of the time it's not working.
Please help me I am new in Sikuli as well as in java.

Thanks and Regards
 Divesh Pathak

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


[Sikuli-driver] [Question #233001]: startup problem in sikuli

2013-07-25 Thread Amutha Sreenivasan
New question #233001 on Sikuli:
https://answers.launchpad.net/sikuli/+question/233001

Hi ,

  using latest  sikuli for automating test cases.

My scenario:

Test case ---> means Test step (i.e , single step in a test document . eg : 
login to gmail)(each step roughly contains 100 to 150 lines of code)

Test plan --> Each test plan (ie , test document) contains  atleast  25 test 
steps.

Wrote scripts  in sikuli tool itself. It generates a python file after save. 

sometimes to edit a file (eg: for adding extra wait , changing offset , 
changing similarity %), open the file () in notepad++ and edit & 
save it.

Run the tests from tool using "run" button.

Haven't used any logging.

using HTMLTestrunner to generate reports.

Problems  are:

while running all testcases/test steps in one run,

1.Sikuli tool display disappears(as expected) , but it gets stuck and CPU 
usuage goes upto 100% . It is not allowing to click any application.waited for 
nearly 20 minutes , but no response. Then forcefully close it. After that only, 
CPU usage goes down.This happens everytime .

2. In the above situation, if I pressed "alt+shift+c" continuously for more 
than 10 times, sikuli tool display pops up. But after that also, if I click run 
, no response.

3. But , Above problem 1 & 2 not happening while running only 5 test cases/test 
steps.

4. Even while running 5 test steps also, if I want to stop the run in the 
middle , even after pressing "alt+shift+c" , it doesn't stop. It just come out 
of that step and started to execute next step.

5. In the Test step (sample given below), if some unexpected error occurs , I 
want to stop whole execution automatically by the tool itself

try:
find(Pattern("Netpoint_create_confirm.png").similar(0.80))
 except FindFailed:
print("Unexpected Error in MPLS_creation")
exit(0)
But it prints that message , but not exit. Alternatively it skips this step and 
goes to next.


much appreciated if I get answers for above problems. 
Happy to give more details if need.









-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #232998]: Eclipse and Sikuli IDE are inconsistent in some places

2013-07-25 Thread RaiMan
Question #232998 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/232998

Status: Open => Answered

RaiMan proposed the following answer:
according to the Python rules (language level 2.5), a module to be
imported must be found in one of the folders contained in sys.path at
time of import.

This is simulated for .sikuli folders with respect to the contained .py
files by a Sikuli plugin to the Jython import support
(SikuliImporter.py) which is initialized at startup (from sikuli import
*). The internal magic is, that not only the sys.path is managed
accordingly, but also the image path, so no handling of bundlepath is
needed in this case.

Python supports having a folder structure, that in turn contains
modules, that can be imported using the dotted notation. Only the top
folder must be in sys.path.

# example
main.py or main.sikuli
subsfolder
sub1.py
sub2.py
subsubsfolder
subsub1.py
subsub2.py

so in main you could say:
import subsfolder.sub1
import subsfolder.subsubsfolder.subsub2

running main.py with "from sikuli import *" or main.sikuli this will
work, since the Sikuli import support looks in the same directory.

*** Now there is one important prereq for this to work: 
every folder in such a tree MUST have an __init__.py, which might be empty.

So the finally working structure is:

main.py or main.sikuli
subsfolder
__init__.py
sub1.py
sub2.py
subsubsfolder
__init__.py
subsub1.py
subsub2.py

Besides being a signal for a module structure, __init__.py can contain
code, that supports some features of this folder and is once run at
import (or again at reload())

You might as well put additional .sikuli folders into this structure,
but to make them importable, currently their parent folder must be in
sys.path at time of import. I have on the list, to support such mixed
structures via SikuliImporter.

Why this works in Eclipse without the __init__.py I cannot tell you. But
with them it should work too.

*** Looking now at step 2 of your concept:
Everything, that your users should access via Sikuli-IDE GUI, must be in a 
folder .sikuli having a .py with the same name and might be additional images 
(to be able to edit standalone .py files with Sikuli IDE is on the list).

To just run the main.sikuli or main.py, you only need sikuli-script.jar:

java -jar sikuli-script.jar -r main.sikuli

or

java -cp sikuli-script.jar org.python.util.jython main.py

So the user of your package only needs sikuli-script.jar or sikuli-ide.jar. 
version 1.0.1 will make all this much easier. 

In any case: the challenge is the organization of the images needed for
the find operations.

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #232998]: [HowTo] setup import/module structures to be used in Eclipse/Jython and Sikuli IDE/Script as well

2013-07-25 Thread RaiMan
Question #232998 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/232998

Assignee: None => RaiMan

Summary changed to:
[HowTo] setup import/module structures to be used in Eclipse/Jython and Sikuli 
IDE/Script as well

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #233001]: startup problem in sikuli

2013-07-25 Thread RaiMan
Question #233001 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/233001

Status: Open => Answered

RaiMan proposed the following answer:
--- You say you use HTMLTestRunner
So you must have organized your stuff using the features from Python unit test 
principally like this:

# a testA.sikuli
class UnitTestA(unittest.TestCase):
def setUp(self):
popup("setting things up")
def test1(self):
popup("running test1")
def test2(self):
popup("running test2")
def test3(self):
popup("running test3")
def tearDown(self):
popup("tearing things down")

Wether this is a test step or a test document in your sense is not
clear.

so you might have more of these testX.sikuli

To run the stuff you must somehow have a maintest.sikuli and import the
testX.sikuli and build a suite by selecting test classes and/or test
def()s using the features of unit test and then finally run the suite
using HTMLTestRunner.

If you are using the latest Sikuli (version 1.0.0), then you could insert 
Debug.user()
calls in the setUp()and tearDown() functions and selectively in main test 
functions and a user log file even with timestamps, so you see what happens.

So it is still not clear, why your problems in the first run have something to 
do with Sikuli features. If you are using the unit test framework, then using 
exit() in a test function does not lead to a general stop of running, since the 
magic of unit test is to catch all exceptions and report them. 
At the current language level 2.5, that is used by Sikuli a graceful 
termination of a unittest run is not supported.

The easiest way, to implement a graceful termination is to look at every
start of a new test step, wether a global termination switch is on and
then simply return immediately with an exception "skipped by
termination".

Another option might be to use unittest2 which is a backport of the unit test 
of level 2.7 to language level <2.7
But you would have to modify HTMLTestRunner, so it uses unittest2.

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


[Sikuli-driver] [Bug 1204634] Re: Find fail after use it for a long time

2013-07-25 Thread RaiMan
I accept this as a request bug in 2 directions:

1. provide better tracking/documentation options for search operations

2. support some dynamic automatic adjustment for the waiting time, based
on e.g. cpu-usage level and/or average search times up to now.

** Summary changed:

- Find fail after use it for a long time
+ [1.0] Find fail after use it for a long time

-- 
You received this bug notification because you are a member of Sikuli
Drivers, which is subscribed to Sikuli.
https://bugs.launchpad.net/bugs/1204634

Title:
  [1.0] Find fail after use it for a long time

Status in Sikuli:
  In Progress

Bug description:
  Version: Sikuly finally 1.0.0
  OS: Windows 7 64-bits
  Reproduce: Execute find operations for a long period of time.

  When I use the find operation (or others than use find inside) on a
  automatized scenario during long periods of time, the find operation
  fail in some point, if I try to find the image again is found but in a
  long execution it fails, and not always the same image fail.

To manage notifications about this bug go to:
https://bugs.launchpad.net/sikuli/+bug/1204634/+subscriptions

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


[Sikuli-driver] [Bug 1204634] Re: Find fail after use it for a long time

2013-07-25 Thread RaiMan
FindFailed exceptions are only raised/thrown, if a (explicit or
implicit) search (explicit or implicit) for an image on the screen is
not successful within the given wait time (in the standard 3 seconds).

In long running situations, there might be other system aspects that
eventually lead to a delay of the GUI actions and hence to a FindFailed.
This can only be debugged, if you take care, that a screenshot of the
FindFailed situation is available afterwards (e.g. the latest screen
image used to search).

Currently, there is no compact feature in Sikuli to support such a
tracking. You must setup your own function and use it instead of all (or
at least the critical ones).

Another option is to replace all find operations with wait(image,
maxtime)

e.g. instead of 
click(some_image)

use
click(wait(some_image, 20))

which does not do any harm, since it will come back in the moment the
some_image appears, but add some robustness for situations, where the
image's appearance is delayed for a reason you cannot foresee in your
script.

** Changed in: sikuli
   Status: New => In Progress

** Changed in: sikuli
   Importance: Undecided => Medium

** Changed in: sikuli
 Assignee: (unassigned) => RaiMan (raimund-hocke)

** Changed in: sikuli
Milestone: None => 1.1.0

-- 
You received this bug notification because you are a member of Sikuli
Drivers, which is subscribed to Sikuli.
https://bugs.launchpad.net/bugs/1204634

Title:
  [1.0] Find fail after use it for a long time

Status in Sikuli:
  In Progress

Bug description:
  Version: Sikuly finally 1.0.0
  OS: Windows 7 64-bits
  Reproduce: Execute find operations for a long period of time.

  When I use the find operation (or others than use find inside) on a
  automatized scenario during long periods of time, the find operation
  fail in some point, if I try to find the image again is found but in a
  long execution it fails, and not always the same image fail.

To manage notifications about this bug go to:
https://bugs.launchpad.net/sikuli/+bug/1204634/+subscriptions

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #232726]: [1.0] Linux: Centos 6.4-64: Clicking 'Run' closes the IDE and script is not run

2013-07-25 Thread Steve Baldino
Question #232726 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/232726

Status: Open => Needs information

Steve Baldino requested more information:
I have the same issue but my /usr/local/lib looks like this:

ls -l /usr/local/lib
total 106868
-rwxrwxrwx. 1 root root  9012378 Jul 25 10:25 liblept.a
-rwxrwxrwx. 1 root root  964 Jul 25 10:25 liblept.la
lrwxrwxrwx. 1 root root   16 Jul 25 10:25 liblept.so -> liblept.so.3.0.0
lrwxrwxrwx. 1 root root   16 Jul 25 10:25 liblept.so.3 -> liblept.so.3.0.0
-rwxrwxrwx. 1 root root  5417957 Jul 25 10:25 liblept.so.3.0.0
-rwxrwxrwx. 1 root root 69754390 Jul 25 10:32 libtesseract.a
-rwxrwxrwx. 1 root root  972 Jul 25 10:32 libtesseract.la
lrwxrwxrwx. 1 root root   21 Jul 25 10:32 libtesseract.so -> 
libtesseract.so.3.0.2
lrwxrwxrwx. 1 root root   21 Jul 25 10:32 libtesseract.so.3 -> 
libtesseract.so.3.0.2
-rwxrwxrwx. 1 root root 25228653 Jul 25 10:32 libtesseract.so.3.0.2
drwxrwxrwx. 2 root root 4096 Jul 25 10:32 pkgconfig

I get the following error in java:

java.lang.UnsatisfiedLinkError:
/home/user/SikuliX/libs/libVisionProxy.so: libtesseract.so.3: cannot
open shared object file: No such file or directory

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #232962]: Sikuli doesn't work if reduce or close Remote Desktop

2013-07-25 Thread dinev
Question #232962 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/232962

Status: Open => Answered

dinev proposed the following answer:
This is well known problem.

First of all you should not close your RDC. If you do this the machine
becomes headless - NO UI. Any UI automation tool will fail in this case

However You can solve the minimize problem by following those
instructions

http://www.8bitavenue.com/2012/10/running-gui-tests-in-minimized-
windows-remote-desktop/

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #230237]: [1.0 ]Sometimes "wait" hangs in sikuli 1.0

2013-07-25 Thread dinev
Question #230237 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/230237

Status: Answered => Open

dinev is still having a problem:
I got this problem again today - 2 times. One test hangs for 13 hours.
Another for 3h.

The problem is not the AUT. If it is doesn't react to the click that
fine - it is AUT bug. My big concern is that sikuli hangs indefinitely.
This should never happen. Test should always complete and fail if AUT
doesn't perform as expected.

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


[Sikuli-driver] [Question #233031]: Image Management with Eclipse

2013-07-25 Thread John F Leach
New question #233031 on Sikuli:
https://answers.launchpad.net/sikuli/+question/233031

Can anyone point me to a solution for managing images with eclipse?

Is there a way to integrate/clone the Sikuli IDE features (i.e., Take 
Screenshot) and have that feature work in eclipse?  Some code examples would be 
appreciated to invoke the screenshot utility and save them in a PyDev project.

Thanks all and RaiMan especially.  :)

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #233031]: Image Management with Eclipse

2013-07-25 Thread John F Leach
Question #233031 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/233031

Description changed to:
Can anyone point me to a solution for managing images with eclipse?

Is there a way to integrate/clone the Sikuli IDE features (i.e., Take
Screenshot) and have that feature work in eclipse?  Some code examples
would be appreciated to invoke the screenshot utility and save the
images to a PyDev project.

Thanks all and RaiMan especially.  :)

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #232998]: [HowTo] setup import/module structures to be used in Eclipse/Jython and Sikuli IDE/Script as well

2013-07-25 Thread Parn Yin
Question #232998 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/232998

Status: Answered => Solved

Parn Yin confirmed that the question is solved:
Thanks RaiMan, that solved my question.

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #232998]: [HowTo] setup import/module structures to be used in Eclipse/Jython and Sikuli IDE/Script as well

2013-07-25 Thread Parn Yin
Question #232998 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/232998

Parn Yin posted a new comment:
Thank you, RaiMan!
Yeah, every folder in my tree has an empty __init__.py already.

To avoid misunderstanding, please kindly confirm/answer:

(a) If I want to use Sikuli IDE to open subsub2.py file, I need to
change it to:

main.py or main.sikuli
subsfolder
__init__.py
sub1.py
sub2.py
subsubsfolder
__init__.py
subsub1.py
subsub2.sikuli
subsub2.py

(b) If I want to import subsub2.py into subsub1.py, I need to add the
path of "subsubsfolder" to the sys.path.

(c) In the plan of Sikuli version 1.0.1, when will it be released? For
these things above, what will be enhanced?

Thank you.

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


[Sikuli-driver] [Question #233046]: IDE and Multiple Monitors

2013-07-25 Thread juillarr
New question #233046 on Sikuli:
https://answers.launchpad.net/sikuli/+question/233046

Am I correct in saying that there is not a good way to handle multiple using 
thee GUI.  

One can write the script to look for the 2nd montior, but not an easy way from 
the GUI to cause the "capture" process to run on the 2nd monitor.  Almost seems 
like there should be a dynamic "Take screenshot" that provides a indication for 
the monitor.

Future feature with all the dual monitors on systems these days?

I haven't looked at the code yet to see how hard it would be to add.


-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp