← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #173896]: iPhone simulator: How can we Scroll Down to delete a contact in Automation.

 

Question #173896 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/173896

    Status: Open => Answered

RaiMan proposed the following answer:
So if you do it the same way as on the iPhone, you are using either a
trackpad on a MacPro or the built-in trackpad of some
MacBook/MacBookPro/MacBookAir to do the swiping on the phone simulator
window (double-tap_hold_move-up/down).

This works in the settings view of the simulator:

ip = App("iPhone Simulator")
ip.focus()
ipw = ip.window()
#ipw.highlight(2)
bottom = "1318343141834.png" # see comment
mBottom = ipw.find(bottom)
p = mBottom.getTopLeft().above(10).right(15)
hover(p)
mouseDown(Button.LEFT)
mouseMove(p.above(100)) 
mouseUp()

I position the mouse in the lower left corner of the app view, press-hold left button and move in the wanted direction.
The image "bottom" is the black area with the home button below the app view.
If you test this script you might have to adjust the pixel values.

your problem:

while not ipw.exists (image-of-delete-button, 0):
    hover(p)
    mouseDown(Button.LEFT)
    mouseMove(p.above(100)) # choose your stepping
    mouseUp()
    wait(1)
click(ipw.getLastMatch()) # should click delete button

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