Luthfi Rahmad
Luthfi Rahmad

Reputation: 31

Click two buttons sequentially with TouchActions

I am newbie using Appium. My feature flow is using android camera UI like this: Android emulator camera UI

So after i take photo, there is "check button" beside "shutter button". The problem is, after appium check element in shutter button and doing tap action on it, it can't locate next element, it means "check button". My script just like this:

Then ("I click shutter camera button and confirm it") do

action_one = Appium::TouchAction.new.tap(x: 531.5, y: 1609.6, count: 1).tap(x: 967.7, y: 1626.0, count: 1)

action_one.perform

end

How to perform TouchAction in two different buttons sequentially?

Upvotes: 0

Views: 198

Answers (2)

sameeksha sahib
sameeksha sahib

Reputation: 174

What error are you getting exactly?

Try adding waitAction() between two tap actions: action_one = Appium::TouchAction.new.tap(x: 531.5, y: 1609.6, count: 1).waitAction().tap(x: 967.7, y: 1626.0, count: 1)

Upvotes: 2

pankaj mishra
pankaj mishra

Reputation: 2615

Tapping on coordintates are not recommened approach as it might give you inconsistent results. Better way is to find element id or Xpath of the element on which you want to click.

You can use Appium Desktop to find the xpath or Element id for the requested element

Upvotes: 0

Related Questions