Help with crosswalk XWalkView query.

132 views
Skip to first unread message

seun are

unread,
Jul 29, 2015, 12:47:58 PM7/29/15
to calabash-android
Hi Guys,

Please can anyone help me for the right method to use for this:


I am using :

Ruby-2.2.1
gem calabash-android 0.5.12

1)I am testing an android webapp using Crosswalk (XWalkContent  css..) and i am looking for how to write a css query to count a list of total track and validate it with the total shown on top of the page.

2) I want to search for a track on the webapp and when i get the general tracks of songs displayed i will want to validate that the track name i searched for in the previous page is in each results displayed.

Example of my query command that i have used is : element_exist("XWalkView css:',header-button'")

Please see attached screenshot.

Please kindly let me know if you need more information in order to help me with a solution please i have a dead line in 2 days please somebody please help.

Thanks
Screen Shot 2015-07-29 at 5.28.19 pm.png

seun are

unread,
Jul 29, 2015, 6:29:10 PM7/29/15
to calabash-android, lumm...@gmail.com
Please help me on this

Pas

unread,
Jul 30, 2015, 2:33:12 AM7/30/15
to calabash-android, lumm...@gmail.com
I don't now how your HTML structure looks like but query with query("XWalkView css:'*'") and look at the result, for example by printing it. Then look at the HTML elements and query for the ones you are looking and then validate them.

seun are

unread,
Jul 30, 2015, 5:06:55 AM7/30/15
to calabash-android, pascalz...@gmail.com
Thanks for that insight Pas, here is my line of command i used:

("XWalkContent css:'p' {textContent CONTAINS 'Michael Buble'}").count # which counts how many  'Michael Buble' is listed.

result= 3


I want to make sure i have a line of calabash-android command that will look at the result '3' and validates it matches the total list populated on top on the search result page.


Is this doable ?

Pas

unread,
Jul 30, 2015, 5:56:44 AM7/30/15
to calabash-android, lumm...@gmail.com
You will probably have to query for that total list populated element too and then fail if it is not the same. At least that's the way I would do it.

expected = query('your query for the total comes here')
displayed
= query("XWalkContent css:'p' {textContent CONTAINS 'Michael Buble'}").count

fail
("There are not as many elements displayed as expected: Expected were #{expected} and displayed were #{displayed}") unless (expected.to_i == displayed)

The above example is untested!

seun are

unread,
Jul 30, 2015, 7:59:28 AM7/30/15
to calabash-android, pascalz...@gmail.com
Hi Pas,

Thanks you soo much for taking time to answer my questions. I shall give it a try now and i believe it will work.
Thanks a million times.
Reply all
Reply to author
Forward
0 new messages