Why not dynamically create a region based on the corners of the
dropdown?

It wouldn't matter what direction the dropdown opens since the user will
specify what the top left, bottom left, and top right region look like.
If you capture the images carefully it won't matter what is behind the
dropdown or how many options are in the dropdown (important in most of
my scenarios). If all actions relating to the dropdown utilize this
region it will also allow for separate scoping of both up/down/scroll
arrows and any text searches by OCR.

The code is pretty simple to abstract into a function, or superclass
depending on how Object Oriented the project is, and re-use all over the
project.  I feel like from an OO perspective that it seems a little
domain specific to be built into sikuli as a class of some kind, but as
a function the logic would be as simple as (psuedo code):

openDropDown(ddHead, topLeft, topRight, bottomLeft):
    click the head
    find each image
    calculate the width from topLeft to topRight
    calculate the height from topLeft to bottomLeft
    region(topLeft.getX(), topLeft.getY(), width, height)

Here the most general case would be to return that new region, however
if it were part of a class it could be set as an attribute and then
provide scrolling, clicking, and reading options.

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

Title:
  [request] want a feature to select an image in a drop down list

Status in Sikuli:
  Incomplete

Bug description:
  Hello.

  It's probably one of the most difficult thing to do with Sikuli.
  I have no solution at all to generalize this function to work every time.
  But I think it will be more than useful.

  -- system --
  Sikuli 1.0.1
  Win 7 (32)
  Java 1.7.51

  Regards.

To manage notifications about this bug go to:
https://bugs.launchpad.net/sikuli/+bug/1270177/+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

Reply via email to