Can anyone tell me how to locate elements in calabash-ios?

464 views
Skip to first unread message

willem...@gmail.com

unread,
Jan 6, 2015, 9:59:58 PM1/6/15
to calaba...@googlegroups.com
Dear all ,
I am a fish in calabash-ios. I don't know how to locate elements in IOS app, so i can't run features.
For calabash-android, I know the IDs,text,etc. So I can run calabash-android.
Now, I finished setup the environment, and I can open my app on my Iphone, but the feature is not running. So I think the elements is not correct because I don't which element I need.  So can you tell me how to make calabash-ios to run? 

Jeff Hatfield

unread,
Jan 7, 2015, 12:57:35 PM1/7/15
to calaba...@googlegroups.com
I'm not sure what you're asking. 
I think you're looking for Accessibility Labels. They're sort of the equivalent to ID's for the Android. You can query all the Accessibility Labels on the screen with
label "*"

willem...@gmail.com

unread,
Jan 14, 2015, 10:57:11 PM1/14/15
to calaba...@googlegroups.com
Thank you Jeff,

Actually, I mean, I don't know who to wright my feature and step definitions. And I can't find both files matched on the internet, what i want to know is, For example in calabash-android:
Feature: Log in feature
 Scenario: As a user, I want to log in to my app
 When I input "username" in "username_input_filed"
 When I input "password" in "password_input_filed"
 When I click on "Log in" button
 Then I see "Welcome"

calabash_step.rb
require 'calabash-android/calabash_steps'

UI = {
  "username_input_filed"=>"et_login_username",
  "password_input_filed"=>"et_login_pwd",
  "Log in"=>"btn_login"

}

DIALOG={

}

When (/^ I input "([^\"]*)" in "([^\"]*)"$/) do |text,element|
  enter_text("android.widget.EditText id:'#{UI[element]}'", text)
end

When (/^ I click on "([^\"]*)" button) do |element|
  tap_when_element_exists("* id:'#{UI[element]}'")
end

Then I run my feature it will work. 
So, How can i do this when using calabash-ios to run ios app?
Thank you.



在 2015年1月8日星期四 UTC+8上午1:57:35,Jeff Hatfield写道:

Ian McWilliams

unread,
Jan 16, 2015, 10:32:08 AM1/16/15
to calaba...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages