[Sikuli-driver] [Question #147764]: Basic If usage: Look for image, if not found skip to

2011-03-04 Thread T
New question #147764 on Sikuli:
https://answers.launchpad.net/sikuli/+question/147764

I'm using sikuli to book into gym classes online for my work colleagues. I have 
the basic functionality working, but one of the flaws about the log in process 
is that if someone logs in to check their details and doesnt log out, the 
script to log in bugs out and the whole process fails. Therefore I need it to 
check on the first page it goes to, if LOG OUT is an option.

I found a similar question on this and tried the solution but i get a Cannot 
find img error before it even gets to the if.

img = ( LOGOUT)
if  find(LOGOUT ):
click( logout )
wait(2)
type(accountandpassworddetails)
wait(2)
else:
type(accountandpassworddetails) 
wait(2)
bugs out on first line. Causing me headache.

any ideas? and what would I have to do to make it look for one of 2 pictures, 
like logout or page is currently unavailable?

-- 
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 #147764]: Basic If usage: Look for image, if not found skip to

2011-03-04 Thread RaiMan
Question #147764 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/147764

Status: Open = Answered

RaiMan proposed the following answer:
find() cannot be used in if/elif/while, since it does not return if not
found, but stops the script with a FindFailed exception.

The appropriate method is exists(), which is functionally equivalent,
but returns None in this case.

the most compact form for such cases:

click(exists(logout-image, 0)) # , 0) means only search once, no 3
seconds wait for image

this would click the match found by exists() or does nothing in case not
found.

or in long form if you want to add more scripting:

if exists(logout-image, 0):
   click(getLastMatch()) # avoids another find() operation
   wait(2)
   # some more code
# after the if

-- 
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 #147764]: Basic If usage: Look for image, if not found skip to

2011-03-04 Thread RaiMan
Question #147764 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/147764

Related FAQ set to:
if not found image skip to --- use exists() instead of find()
https://answers.launchpad.net/sikuli/+faq/1501

RaiMan proposed the following answer:
RaiMan suggests this article as an answer to your question:
FAQ #1501: “if not found image skip to --- use exists() instead of find()”.

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 729141] [NEW] Windows 7 32: can't do screen capture in Sikuli X 1.0 RC2

2011-03-04 Thread Roman Podolyan
Public bug reported:

The problem emerge after upgrade from 10.2 to X 1.0 RC2.

After I try to capture (by clicking Click() or Capture button) the
Sikuli IDE just disappears from screen, and then no overlay and
interface for capturing, nothing (process javaw remains in memory).

Capturing with the Sikuli X RC1 -  works.

I read about the problems with Java, so checked mine - latest up to now
jre-6u24 (and JDK) is installed. I even deleted previous Java runtimes -
that didn't help too.

Will try to check this at home on my other Win7 PC.

** 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/729141

Title:
  Windows 7 32: can't do screen capture in Sikuli X 1.0 RC2

Status in Sikuli:
  New

Bug description:
  The problem emerge after upgrade from 10.2 to X 1.0 RC2.

  After I try to capture (by clicking Click() or Capture button) the
  Sikuli IDE just disappears from screen, and then no overlay and
  interface for capturing, nothing (process javaw remains in memory).

  Capturing with the Sikuli X RC1 -  works.

  I read about the problems with Java, so checked mine - latest up to
  now jre-6u24 (and JDK) is installed. I even deleted previous Java
  runtimes - that didn't help too.

  Will try to check this at home on my other Win7 PC.

___
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 729260] [NEW] setROI updates the constant variable SCREEN

2011-03-04 Thread Will P
Public bug reported:

Calling setROI(smaller_region) changes the global variable SCREEN, which
I assume is meant to be constant.  The __str__ function of SCREEN also
isn't updated to reflect the change.

print SCREEN
print SCREEN.getW()
setROI(Region(0,0,100,100)
print SCREEN
print SCREEN.getW()
setROI(SCREEN)

This prints out the following, and at the end the ROI is not updated to the 
entire screen:
Screen(0)[0,0 1440x900] E:Y, T:3.0 
1440 
Screen(0)[0,0 1440x900] E:Y, T:3.0 
100

We can save the original parameters of SCREEN to a variable to get
around this, but it took a while to figure out what was happening.

1. X 1.0 rc2
2. 64 bit Mac OSX 10.6

** 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/729260

Title:
  setROI updates the constant variable SCREEN

Status in Sikuli:
  New

Bug description:
  Calling setROI(smaller_region) changes the global variable SCREEN,
  which I assume is meant to be constant.  The __str__ function of
  SCREEN also isn't updated to reflect the change.

  print SCREEN
  print SCREEN.getW()
  setROI(Region(0,0,100,100)
  print SCREEN
  print SCREEN.getW()
  setROI(SCREEN)

  This prints out the following, and at the end the ROI is not updated to the 
entire screen:
  Screen(0)[0,0 1440x900] E:Y, T:3.0 
  1440 
  Screen(0)[0,0 1440x900] E:Y, T:3.0 
  100

  We can save the original parameters of SCREEN to a variable to get
  around this, but it took a while to figure out what was happening.

  1. X 1.0 rc2
  2. 64 bit Mac OSX 10.6

___
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