How to select a radio button in iOS

468 views
Skip to first unread message

Joe McGuinness

unread,
Nov 5, 2013, 10:19:05 AM11/5/13
to appium-...@googlegroups.com
Hi,

I'm trying to select a radio button in the iOS app I'm testing with appium, but I'm not sure how to go about this. I've checked the type shortcuts in mechanic.js (link at the bottom of this question) but I still cannot find how to select it. The details of this element are:

AXRole: AXRadioButton
AXRoleDescription: radio button

Do I have to use xpath?

Thanks.

Dan Cuellar

unread,
Nov 5, 2013, 10:52:08 AM11/5/13
to appium-...@googlegroups.com
xpath is still kinda iffy. It's probably best to get this element by using tag name.

Dan Cuellar

unread,
Nov 5, 2013, 10:52:23 AM11/5/13
to appium-...@googlegroups.com
Or better yet get the developer to add an ID to it

Joe McGuinness

unread,
Nov 5, 2013, 10:55:36 AM11/5/13
to appium-...@googlegroups.com
Unfortunately its from a login dialog we're getting from facebook so we can't change it. Any other ideas?

Dan Cuellar

unread,
Nov 5, 2013, 12:41:52 PM11/5/13
to appium-...@googlegroups.com
Is this in a web view?

Jonathan Lipps

unread,
Nov 5, 2013, 1:10:01 PM11/5/13
to Joe McGuinness, appium-...@googlegroups.com
If it's not an apple-supported UIElement it might not work. I'm not familiar with AXRadioButton.

--
http://appium.io
---
You received this message because you are subscribed to the Google Groups "Appium-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to appium-discus...@googlegroups.com.
Visit this group at http://groups.google.com/group/appium-discuss.
For more options, visit https://groups.google.com/groups/opt_out.

Joe McGuinness

unread,
Nov 6, 2013, 12:08:21 PM11/6/13
to appium-...@googlegroups.com
Turns out it *is* a web view. Could you point me in the right direction for some instructions to switch focus to this view please? The output of driver.getWindowHandles(); is 1.

Jonathan Lipps

unread,
Nov 6, 2013, 2:21:48 PM11/6/13
to Joe McGuinness, appium-...@googlegroups.com

Joe McGuinness

unread,
Nov 7, 2013, 7:24:58 AM11/7/13
to appium-...@googlegroups.com, Joe McGuinness
Got there in the end. Thanks. 
Reply all
Reply to author
Forward
0 new messages