Accessing a "Cell" and its children
Posted: Fri Mar 08, 2013 4:53 pm
I am testing a iOS app that has a screen that has different cells on it and I want to click the right cell. The cells have names that can be dynamic so I want to make sure I click the correct cell.
The object looks like this:
/mobileapp/form/container/container/container/ioselement/cell/cell[@accessibilitylabel='Member:Dog, Droopy']
if there is more than one the other cells look like this:
/mobileapp/form/container/container/container/ioselement/cell[2]/cell[@accessibilitylabel='Member:Hound, Huckleberry']
/mobileapp/form/container/container/container/ioselement/cell[3]/cell[@accessibilitylabel='Member:McGraw, QuickDraw']
I am having trouble trying to access the correct cell. I want to loop through the cells, check to see if the attribute of accessibilitylabel is the one I want and then click it.
I made my object be /mobileapp/form/container/container/container/ioselement/cell in my repository and when i did:
obj.Children.Count
I got a count of 3 so I appear to be on the correct path here. I then I tried to put the items in a list so I could check them:
Ranorex.Cell List = obj;
IList<Unknown> cells = List.FindChildren<Unknown>(".//Cells");
When I do a count on 'cells' I get 0 items in the list.
I have tried many combinations of the list above to no avail. I have also tried to set the object to /mobileapp/form/container/container/container/ioselement/. in the repository and I still get the same results.
Has anyone else tried to do something like this, or see the errors in my ways?
Matt
The object looks like this:
/mobileapp/form/container/container/container/ioselement/cell/cell[@accessibilitylabel='Member:Dog, Droopy']
if there is more than one the other cells look like this:
/mobileapp/form/container/container/container/ioselement/cell[2]/cell[@accessibilitylabel='Member:Hound, Huckleberry']
/mobileapp/form/container/container/container/ioselement/cell[3]/cell[@accessibilitylabel='Member:McGraw, QuickDraw']
I am having trouble trying to access the correct cell. I want to loop through the cells, check to see if the attribute of accessibilitylabel is the one I want and then click it.
I made my object be /mobileapp/form/container/container/container/ioselement/cell in my repository and when i did:
obj.Children.Count
I got a count of 3 so I appear to be on the correct path here. I then I tried to put the items in a list so I could check them:
Ranorex.Cell List = obj;
IList<Unknown> cells = List.FindChildren<Unknown>(".//Cells");
When I do a count on 'cells' I get 0 items in the list.
I have tried many combinations of the list above to no avail. I have also tried to set the object to /mobileapp/form/container/container/container/ioselement/. in the repository and I still get the same results.
Has anyone else tried to do something like this, or see the errors in my ways?
Matt