how to write query for 2 elements with same name?

50 views
Skip to first unread message

Dipa Shah

unread,
Jan 25, 2017, 1:07:15 AM1/25/17
to calabash-android
hi,

i have 2 textbox
1)uname
2)pwd

id of both textbox is same ...


how can i write in step defination file to get uname and password?
i have tried this
Then(/^I click on email textbox$/) do

      touch("android.widget.EditText id:'text'")
query("android.widget.EditText id:'text'",{:setText=>'narend...@gmail.com'})
end


how can i get element with same id????

Any answer will greatly appreciated.


Thnks in Advance.

Ivan Ushakov

unread,
Jan 30, 2017, 3:26:53 AM1/30/17
to calabash-android
Looks like you can use numbers (array possition), like:

touch("android.widget.EditText id:'text'")[0] (or any other depends of amount of elements)


On Wednesday, January 25, 2017 at 8:07:15 AM UTC+2, Dipa Shah wrote:
hi,

i have 2 textbox
1)uname
2)pwd

id of both textbox is same ...


how can i write in step defination file to get uname and password?
i have tried this
Then(/^I click on email textbox$/) do

      touch("android.widget.EditText id:'text'")
query("android.widget.EditText id:'text'",{:setText=>'narendram...@gmail.com'})
end
Reply all
Reply to author
Forward
0 new messages