[Sikuli-driver] [Question #240570]: Screenshot after test execution

2013-12-10 Thread Leonardo Carvalho Sobral dos Santos
New question #240570 on Sikuli:
https://answers.launchpad.net/sikuli/+question/240570

Hi, 

I'd like to know, how can I do to after each test execution, sikuli take a 
Screenshot.
For example;

actually I'm doing like this;

testOk = 0;
testNok = 0;

try:
   .
   .
   .

monthView()
print(Test 11 - Passed)
testOk = testOk +1;

except:

print(Test 11 Failed)
testNok = testNok +1;   

.
.
.

print (Test OK,testOk)
print (Test Not OK,testNok)

what command should I add to if test pass or fail, application take a 
Screenshot of page?



-- 
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 #240570]: Screenshot after test execution

2013-12-10 Thread Leonardo Carvalho Sobral dos Santos
Question #240570 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/240570

Leonardo Carvalho Sobral dos Santos posted a new comment:
I'm using Sikuli ide

-- 
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 #240570]: Screenshot after test execution

2013-12-10 Thread RaiMan
Question #240570 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/240570

Status: Open = Answered

RaiMan proposed the following answer:
def takeShot(filename):
import shutil
shutil.move(capture(SCREEN), filename))

... and then use 
takeShot(some-path/.../some-name.png)

and you will have the image on the filesystem at
some-path/.../some-name.png

-- 
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 #240570]: Screenshot after test execution

2013-12-10 Thread Leonardo Carvalho Sobral dos Santos
Question #240570 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/240570

Status: Answered = Open

Leonardo Carvalho Sobral dos Santos is still having a problem:
Ok,

I'm using Sikuli ide to make scripts

This is a part of my scripts;

def monthView():

try:

find(1386607213938.png)
click(1386607213938.png)
sleep(3)

while exists(1386591483816.png):
find(1386591501792.png)
click(1386591501792.png)
sleep(3)
if exists(1386674062665.png):
find(1386674062665.png)
click(1386674062665.png)

else: 
print(Error to find month button)


if exists(Pattern(1386674929878.png).similar(0.80)):
print(Calendar opened in month view)
dragDrop(1386676773871.png, 1386676778404.png)
if exists(1386676800162.png):
print(Calendar opened in month view)
else:
print(error:Calendar opened in month view)
raise exception
else: 
print(error:Calendar opened in month view)
raise exception

except:
raise exception


##Tests Suits##


testOk = 0;
testNok = 0;

try:
   .
   .
   .

monthView()
print(Test 11 - Passed)
testOk = testOk +1;

except:

print(Test 11 Failed)
testNok = testNok +1;

.
.
.

print (Test OK,testOk)
print (Test Not OK,testNok)



So the way you said , I would change to


def takeShot(filename):
try:
import shutil
shutil.move(capture(SCREEN), filename))
except:
 raise exception
def monthView():

try:

find(1386607213938.png)
click(1386607213938.png)
sleep(3)

while exists(1386591483816.png):
find(1386591501792.png)
click(1386591501792.png)
sleep(3)
if exists(1386674062665.png):
find(1386674062665.png)
click(1386674062665.png)

else: 
print(Error to find month button)


if exists(Pattern(1386674929878.png).similar(0.80)):
print(Calendar opened in month view)
dragDrop(1386676773871.png, 1386676778404.png)
if exists(1386676800162.png):
print(Calendar opened in month view)
else:
print(error:Calendar opened in month view)
raise exception
else: 
print(error:Calendar opened in month view)
raise exception

except:
raise exception

##Tests Suits##


testOk = 0;
testNok = 0;

try:
   .
   .
   .

monthView()
print(Test 11 - Passed)
takeShot(filename)
testOk = testOk +1;

except:

print(Test 11 Failed)
takeShot(filename)
testNok = testNok +1;

.
.
.

print (Test OK,testOk)
print (Test Not OK,testNok)

-- 
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 #240570]: Screenshot after test execution

2013-12-10 Thread Leonardo Carvalho Sobral dos Santos
Question #240570 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/240570

Leonardo Carvalho Sobral dos Santos gave more information on the question:
i did

def printScreen(filename):
try:
import shutil
shutil.move(capture(SCREEN),filename))
except:
raise exception


and an error is displayed

[error] script [ *Sanity_RMS ] stopped with error in line 6 at column 45
[error] SyntaxError ( mismatched input ')' expecting NEWLINE, )

-- 
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 #240570]: Screenshot after test execution

2013-12-10 Thread RaiMan
Question #240570 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/240570

Status: Open = Answered

RaiMan proposed the following answer:
-- 1. sorry my fault, but ...
stopped with error in line 6 at column 45
[error] SyntaxError ( mismatched input ')' expecting NEWLINE, )

... tells us, that there is one wrong extra closing bracket at the end
;-)

def printScreen(filename):
try:
import shutil
shutil.move(capture(SCREEN),filename)
except:
raise exception

-- 2: no filename given

monthView()
print(Test 11 - Passed)
takeShot(filename)
testOk = testOk +1;

except:

print(Test 11 Failed)
takeShot(filename)
testNok = testNok +1;

filename is a variable, that should hold a valid filename (cannot see
wether and where you do that)

might be something like
filename = Test11Passed.png
and
filename = Test11Failed.png

this will save the shots to the current working 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


[Sikuli-driver] [Bug 1259578] [NEW] classes missing from sikuli-java.jar

2013-12-10 Thread p.elsie
Public bug reported:

I am trying to migrate my Java project from its current dependency on
1.0rc3 to 1.0.1.  I assumed that I am supposed to use sikuli-java.jar in
place of sikuli-script.jar.  When I tell my IDE (IntelliJ) to use this
as a library it shows errors all over the place.  When I open the jar
with 7zip, I can see that there is no Debug.class file in it.  But
Debug.java does exist in the sources that I pulled using git.  Is there
a compiled jar that contains all the classes I need or should I forget
using the jars, and just compile everything from the source?

** Affects: sikuli
 Importance: Undecided
 Status: New

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

Title:
  classes missing from sikuli-java.jar

Status in Sikuli:
  New

Bug description:
  I am trying to migrate my Java project from its current dependency on
  1.0rc3 to 1.0.1.  I assumed that I am supposed to use sikuli-java.jar
  in place of sikuli-script.jar.  When I tell my IDE (IntelliJ) to use
  this as a library it shows errors all over the place.  When I open the
  jar with 7zip, I can see that there is no Debug.class file in it.  But
  Debug.java does exist in the sources that I pulled using git.  Is
  there a compiled jar that contains all the classes I need or should I
  forget using the jars, and just compile everything from the source?

To manage notifications about this bug go to:
https://bugs.launchpad.net/sikuli/+bug/1259578/+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 1259578] Re: classes missing from sikuli-java.jar

2013-12-10 Thread RaiMan
If you have sikuli-java.jar in your project dependencies, you should be
able to browse through the contents. No need to unzip.

In fact, some classes, that where in the package org.sikuli.script
before, but never where intended to be part of the official API, have
been moved to org.sikuli.basics or have been renamed.

These are the classes, that currently (version 1.0.1) form the official public 
API:
(these will be as backward compatible as possible in the future)
Region.java
Screen.java
Match.java
Location.Java
Pattern.java
App.java
Finder.java

Some helper classes (subject to be changed internally without notice)
(should stay compatible, but deprecated in the future and replaced with others)
Button
FindFailed
ScreenImage
ImageLocator

These are needed for observe:
(should stay compatible, but deprecated because completely under development)
SikuliEvent
SikuliEventAdapter

Classes you might miss in package org.sikuli.script should now be in
org.sikuli.basics.

The class Debug is in the basics package now, but not recommended to be used 
outside.
It will be replaced by a more mature logging feature.
I strongly recommend to use your own logger.

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

Title:
  classes missing from sikuli-java.jar

Status in Sikuli:
  New

Bug description:
  I am trying to migrate my Java project from its current dependency on
  1.0rc3 to 1.0.1.  I assumed that I am supposed to use sikuli-java.jar
  in place of sikuli-script.jar.  When I tell my IDE (IntelliJ) to use
  this as a library it shows errors all over the place.  When I open the
  jar with 7zip, I can see that there is no Debug.class file in it.  But
  Debug.java does exist in the sources that I pulled using git.  Is
  there a compiled jar that contains all the classes I need or should I
  forget using the jars, and just compile everything from the source?

To manage notifications about this bug go to:
https://bugs.launchpad.net/sikuli/+bug/1259578/+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 #240570]: Screenshot after test execution

2013-12-10 Thread Leonardo Carvalho Sobral dos Santos
Question #240570 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/240570

Status: Answered = Solved

Leonardo Carvalho Sobral dos Santos confirmed that the question is solved:
Thank you!!!

Working 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


[Sikuli-driver] [Bug 1259578] Re: classes missing from sikuli-java.jar

2013-12-10 Thread p.elsie
That made my refactoring go much smoother.  I just had to:

* use java.util.logging
* not catch FindFailed (bummer - I had some explicit error messaging)
* Implement my own Env class for detecting OS type, 32/64bit, 
screen-tiles/start-menu

Hopefully everything works now.

Thanks very much.

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

Title:
  classes missing from sikuli-java.jar

Status in Sikuli:
  New

Bug description:
  I am trying to migrate my Java project from its current dependency on
  1.0rc3 to 1.0.1.  I assumed that I am supposed to use sikuli-java.jar
  in place of sikuli-script.jar.  When I tell my IDE (IntelliJ) to use
  this as a library it shows errors all over the place.  When I open the
  jar with 7zip, I can see that there is no Debug.class file in it.  But
  Debug.java does exist in the sources that I pulled using git.  Is
  there a compiled jar that contains all the classes I need or should I
  forget using the jars, and just compile everything from the source?

To manage notifications about this bug go to:
https://bugs.launchpad.net/sikuli/+bug/1259578/+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 1259578] Re: classes missing from sikuli-java.jar

2013-12-10 Thread p.elsie
Actually it was only on the type(String text) and paste(String text)
methods where I removed the FindFailed catch blocks.  It makes sense
that those don't throw FindFailed exceptions anymore.

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

Title:
  classes missing from sikuli-java.jar

Status in Sikuli:
  New

Bug description:
  I am trying to migrate my Java project from its current dependency on
  1.0rc3 to 1.0.1.  I assumed that I am supposed to use sikuli-java.jar
  in place of sikuli-script.jar.  When I tell my IDE (IntelliJ) to use
  this as a library it shows errors all over the place.  When I open the
  jar with 7zip, I can see that there is no Debug.class file in it.  But
  Debug.java does exist in the sources that I pulled using git.  Is
  there a compiled jar that contains all the classes I need or should I
  forget using the jars, and just compile everything from the source?

To manage notifications about this bug go to:
https://bugs.launchpad.net/sikuli/+bug/1259578/+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] [Question #240592]: Input text field or input field that maintains formatting

2013-12-10 Thread dude
New question #240592 on Sikuli:
https://answers.launchpad.net/sikuli/+question/240592

I'm wondering if it's possible to make a text field pop-up box like input but 
with multiple lines that retains formatting.
When I'm copying and pasting stuff into an input field the output always ends 
up being a single long line and I will would prefer to retain formatting if 
possible in some cases

thanks

-- 
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 #240567]: java7 is not supporting fow windows 64 bit

2013-12-10 Thread William Grant
Question #240567 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/240567

Project: Launchpad itself = Sikuli

-- 
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 #240567]: java7 is not supporting fow windows 64 bit

2013-12-10 Thread kishore
Question #240567 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/240567

Status: Open = Solved

kishore confirmed that the question is solved:
I could do this using Sikuli Setup.jar instead of 
Sikuli-X-1.0rc3(r905)-win32.zip.
Problem is solved

-- 
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