Page 1 of 1

Every second run loses stuff

Posted: Thu Nov 12, 2015 5:59 pm
by stapes
I am still testing my app on the iPad.

I find a control using the Spy, the add it to the Repository.
Then I validate it's presence, and select it.

Next time through - it can't find the control again.

Run1:
00:00.272 Info Validation

Validating Exists on item 'Com365agileEnterprise365AgileTEST.UIPickerView1'.
00:01.306 Success Validation

Element for item 'UIPickerView1' does exist.
00:01.312 Info Validation
Jump to item
Validating Exists on item 'Com365agileEnterprise365AgileTEST.ListItemDev1'.
00:01.334 Success Validation

Element for item 'ListItemDev1' does exist.
00:01.335 Info Invoke Action

Invoking Select() on item 'Com365agileEnterprise365AgileTEST.ListItemDev1'.
00:02.751 Info Validation

Validating Exists on item 'Com365agileEnterprise365AgileTEST.Select1'.
00:03.710 Success Validation

Element for item 'Select1' does exist.
00:03.715 Info Touch

Touch item 'Com365agileEnterprise365AgileTEST.Select1' at Center
Run 2:
Element for item 'UIPickerView1' does not exist (Failed to find item 'Test_365AgilePortalRepository.Com365agileEnterprise365AgileTEST.UIPickerView1'. No element found for path '/mobileapp[@title='com.365agile.enterprise.365Agile-TEST']/form/container[3]/container/container/iospicker' within 2m.).
Once again, I invoke the Spy. The element IS there.

I have attached a snapshot.

Re: Every second run loses stuff

Posted: Fri Nov 13, 2015 8:51 am
by odklizec
Hi,

It's because the xpath in your repository is different from the actual xpath.

This is path from your failed attempt:
/form/container[3]/container/container/iospicker
And this is from snapshot:
/form/container[4]/container/container/iospicker

Do you see the difference? The container index is apparently not persistent. So you should either to remove the index, or replace it with something else. Unfortunately, looking at the snapshot, your AUT is not very automation friendly ;) You should ask devs to add some IDs here or there. Otherwise, you will have a hard time to make your tests reliable.

Re: Every second run loses stuff

Posted: Fri Nov 13, 2015 12:08 pm
by stapes
I added code to try the alternative path if one failed. It now works!