← Back to team overview

sikuli-driver team mailing list archive

[Bug 1270177] Re: [request] want a feature to select an image in a drop down list

 

Ok, thanks for the input ...
... but this is not really what I expected.

At least, this could help as a general guideline to approach an
individual solution (based on your suggestion):

def selectInDropDown(img1, img2):
# img1 need to have the width of the drop down opening below
# img2 is a capture of an element in the list
    ddhead = exists(img1)
    if not ddhead: return False # dd head not found
    ddlist = ddhead.below() # assuming list opens below
    img3 = capture(ddlist)
    click(ddhead)
    ddlist.waitVanish(img3)  # wait for list to open
    while not ddlist.exists( img2, 0):
         img4 = capture(ddlist)
         type(Key.PAGE_DOWN); wait(1)
         if (delist.exists(img4, 0): return False // end of list reached
     click ddlist.getLastMatch()
     return True

What I am after is some Pattern like definition of the list physics and
then you can say:

dd = DDPattern(....)
ret = click(DDPattern.use(img2))
if ret = .....

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


References