Calabash - Android - Finding Ids and handling placeholders -


i'm new calabash, have spent day learning (including getting setup).

one thing need how find ids ease. have android app, contains placeholder text username.

i've tried following not working (i keep getting timeout error presume down not being able find):

when enter "some@user.com" "username" 

so questions:

1- above correct if want enter email field username 2- if didnt have placeholder above how can obtain references or ids , use in then /^i enter "([^\"]*)" input field number (\d+)$/

many thanks.

to find locators should use calabash console. if run
calabash-android console your_app.apk
once starts
reinstall_apps
, then
start_test_server_in_background.

once it's running can use calabash query syntax find elements want interact - https://github.com/calabash/calabash-ios/wiki/05-query-syntax.

to started query("*") return on screen.

query("id:'usernamefield'") return element id usernamefield.

to check if it's 1 want can use flash("id:'usernamefield'") make flash few times on emulator/device.

then interact it, advise not using pre written steps. make own step definition , remember require in files need use calabash if haven't

require 'calabash-android/operations'  when /^i enter username (.*)$/ |username|   enter_text("id:'usernamefield'", username) end 

the prewritten steps can useful end making scenarios hard read, , once more complicated things have write own steps anyway.

to decide correct commands step definition can useful run commands, e.g. enter_text("id:'usernamefield'", 'username_you_want') in calabash console don't have run tests everytime add line.


Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -