Visible, Enabled and Valid returning incorrect values

Class library usage, coding and language questions.
jlowder
Posts: 55
Joined: Wed Dec 30, 2009 2:56 pm

Visible, Enabled and Valid returning incorrect values

Post by jlowder » Thu Jan 19, 2012 5:30 pm

I have a .Net application that I'm working on and when selecting certain drop down values I'm trying to make sure that a group of "refund address" text boxes and combo boxes do not appear in the GUI.

If I execute:

Code: Select all

Ranorex.Text address1;
var addressExists = Host.Local.TryFindSingle("/form[@controlname='MainForm']/element/form[@controlname='PaymentEntry']/container[@controlname='grpAddress']/text[@controlname='txtRefAddr_Line1']/text[@accessiblename='txtRefAddr_Line1']", out address1);
                //Assert.That(address1.Visible, Is.False);
                var blah = address1.Visible;
                var blah2 = address1.Enabled;
                var blah3 = address1.Valid;
blah, blah2 and blah3 all return true even though the objects are not visible in the GUI. I can see maybe Valid returning true if the objects are there, just not displayed, but enabled and visible should return false.

Is there another way I can try to determine that these objects aren't visible?

Thanks,

Jason

jlowder
Posts: 55
Joined: Wed Dec 30, 2009 2:56 pm

Re: Visible, Enabled and Valid returning incorrect values

Post by jlowder » Thu Jan 19, 2012 7:51 pm

I found an external container that held these objects which was being turned on/off. I'm just accessing this one instead.

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Visible, Enabled and Valid returning incorrect values

Post by Support Team » Fri Jan 20, 2012 10:43 am

Hi,

Sometimes there are controls which exist out of more components, during recording (you have to Enable Hotkeys first) or spying you can use the "Roll Mouse Wheel" to change the level of UI element selection.

Regards,
Markus
Ranorex Support Team
.
Image