Every second run loses stuff

Ask general questions here.
stapes
Posts: 206
Joined: Wed Sep 16, 2015 10:55 am

Every second run loses stuff

Post by stapes » Thu Nov 12, 2015 5:59 pm

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.
Attachments
IOS_Select_Profile20151112_165532_0_rxlog.rxsnp
Snapshot showing elusive element
(766.8 KiB) Downloaded 42 times

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3937
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Every second run loses stuff

Post by odklizec » Fri Nov 13, 2015 8:51 am

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.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

stapes
Posts: 206
Joined: Wed Sep 16, 2015 10:55 am

Re: Every second run loses stuff

Post by stapes » Fri Nov 13, 2015 12:08 pm

I added code to try the alternative path if one failed. It now works!