Issues finding an element in the second iteration.

Ask general questions here.
ranonub
Posts: 6
Joined: Fri Jan 13, 2017 1:23 am
Location: Sydney, Australia

Issues finding an element in the second iteration.

Post by ranonub » Fri Jan 13, 2017 3:57 am

I am having issues finding a WPF textbox when I repeat a test case in the same test suite run. Basically I have a simple data table and I set values of WPF textbox using that data table. Textboxes I am filling are mandatory and they are checked in real time. Test goes like this;
- Press a button to open a form in a new window.
- Validate the textbox is there.
- Ensure the textbox is visible.
- Focus on the textbox.
- Set the textbox text.
- Press a save button in the same window to save the data and close the window.

This test always succeeds if I run it once but it fails to find the textbox second time. Keeps searching and times out.

If I open the same form window again from a different button in the same test case, it focuses to the first textbox instead of focusing on to the one I want it to focus. I did try focusing on a different textbox and it failed for that as well.

I tried using a different WPF form window and I had the same issue, it doesn't work properly when you open the same window for the second time in a test case.

I am trying figure out it this is an issue with ranorex when using wpf elements or there might be something wrong going on in the background. I am not sure how to debug this issue, so any advice on that might be helpful. From what I can see in the report log it either doesn't find the textbox or it thinks it is doing everything correctly.

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

Re: Issues finding an element in the second iteration.

Post by odklizec » Fri Jan 13, 2017 12:16 pm

Hi,

Try to set the "Use Cache" property of failing element (its parent folder) to False, as described here:
http://www.ranorex.com/forum/can-t-iden ... tml#p41572
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

ranonub
Posts: 6
Joined: Fri Jan 13, 2017 1:23 am
Location: Sydney, Australia

Re: Issues finding an element in the second iteration.

Post by ranonub » Sun Jan 15, 2017 11:06 pm

odklizec wrote:Hi,

Try to set the "Use Cache" property of failing element (its parent folder) to False, as described here:
Perfect! Many thanks.