Test suite reports success - but it did not work

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

Test suite reports success - but it did not work

Post by stapes » Wed Nov 04, 2015 5:51 pm

I am running a Test Syuite that crosses 2 platforms.

It begins by running a Desktop application, where it creates a form.
Then, it logs on to an Android device, finds the form just created, and tests it.

It works - mostly - with one or two little 'vulnerable' spots.

In the first part, it creates a new version of the form & saves it. This works fine.
A bit further on, it tries to repeat this procedure.
This time the dialog in question is left sitting there empty, even though the Report says it has filled in the data OK and Saved it!!
NewFormVersion.PNG
This shows the dialog, still incomplete.
NewFormVersion.PNG (6.49 KiB) Viewed 593 times
Here is the Report:
01:36.340 Info Mouse

Mouse Left Click item 'Form365AgilePortal.FormsContainer.Version2' at 25;14.
01:36.649 Info Mouse
Jump to item
Mouse Left Click item 'Form365AgilePortal.FormsContainer.VersionDetails.NewVersionButton' at 6;8.
01:37.066 Info Validation

Validating Exists on item 'NewFormVersion.NEWFORMVERSION'.
01:37.277 Success Validation

Element for item 'NEWFORMVERSION' does exist.
01:37.278 Info Mouse

Mouse Left Click item 'NewFormVersion.NotesField' at 162;27.
01:37.420 Info Keyboard

Key sequence 'Adding Answer Sets'.
01:37.917 Info Mouse

Mouse Left Click item 'NewFormVersion.RefCode' at 311;8.
01:38.083 Info Keyboard

Key sequence 'Answer Sets'.
01:38.432 Info Validation

Validating Exists on item 'NewFormVersion.CopyUserPermsCheckBox'.
01:38.468 Success Validation

Element for item 'CopyUserPermsCheckBox' does exist.
01:38.468 Info Validation

Validating Exists on item 'NewFormVersion.CopyEndponitsCheckBox'.
01:38.498 Success Validation

Element for item 'CopyEndponitsCheckBox' does exist.
01:38.500 Info User

Save Version button.
01:38.523 Info Mouse

Mouse Left Click item 'NewFormVersion.SaveButton' at 6;8.
01:38.681 Info User

Clicked Save Button.
01:38.686 Info User

Save New Form Version.
01:40.050 Info User

Save Version button.
01:40.060 Info Mouse

Mouse Left Click item 'NewFormVersion.SaveButton' at 6;8.
01:40.204 Info User

Clicked Save Button.
If I leave my SUT running & try it again, it will work.

What is going on?

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

Re: Test suite reports success - but it did not work

Post by odklizec » Wed Nov 04, 2015 6:10 pm

Hi,

My guess is, that despite of click in notes/reference field, neither field is in focus and so the key sequence is send somewhere else. I would suggest to use SetValue instead of key sequence. SetValue is generally more reliable way of filling edit controls. Also, maybe it's a good idea to add notes/reference field validation, right after filling them. Then you should no longer see "success" if the fields are not filled as expected ;)
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: Test suite reports success - but it did not work

Post by stapes » Wed Nov 04, 2015 6:25 pm

Hi odklizec

You may have hit on something there.

I changed my KeyPress to Set Value, and got this error:
Setting attribute 'Text' failed on element '{Unknown:}'.
Failed to set property 'text' on RemoteObject 'WpfHandle{a3012c99-d0e7-487b-806f-315945a8ea88}'.
Instance does not have the requested Property.

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

Re: Test suite reports success - but it did not work

Post by odklizec » Wed Nov 04, 2015 6:30 pm

Do you see property "text" for given element if you track it via Spy? Maybe you just need to use different property?
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

Martin
Posts: 152
Joined: Fri Aug 15, 2014 12:24 pm

Re: Test suite reports success - but it did not work

Post by Martin » Thu Nov 05, 2015 9:08 am

You can use "Value" as well. (e.g. repo.DOM.textField.Value = "" )

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

Re: Test suite reports success - but it did not work

Post by stapes » Fri Nov 06, 2015 3:48 pm

This is very odd. It still fails (although it still reports having worked!) on first run, and works on second run.

The same form is filled out successfully earlier in the test suite.

The controls concerned are WPF controls. I found this out when I tried to use the spy & found that they are listed twice.

This error window pops up if I try to select items from the second of the two definitions:
WPF-warn.PNG
WPF warning message
WPF-warn.PNG (6.59 KiB) Viewed 563 times

jma
Posts: 111
Joined: Fri Jul 03, 2015 9:18 am

Re: Test suite reports success - but it did not work

Post by jma » Mon Nov 09, 2015 4:32 pm

Hi,

If you use the WPF-setting 'WpfPreferred', Ranorex creates two UI trees.
In addition to the WPF tree a UIA tree is created, which is needed for downward compatibility.
I would suggest using the WPF element if you add a new item to the repository.

Concerning the issue, could you upload a Ranorex Snapshot of the corresponding control?

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

Re: Test suite reports success - but it did not work

Post by stapes » Fri Nov 13, 2015 2:51 pm

This is the same issue that was resolved here: http://www.ranorex.com/forum/spy-says-e ... tml#p35368