Disabled select box showing as enabled

Class library usage, coding and language questions.
anzacthecat
Posts: 31
Joined: Mon Jan 10, 2011 1:05 pm

Disabled select box showing as enabled

Post by anzacthecat » Tue Feb 07, 2012 12:59 pm

I need to check if a select box is enabled. The HTML says:
<select name="LocationId" tabIndex="3" id="LocationId" data-val-required="The LocationId field is required." data-val="true" disabled="">
This is showing as greyed out and disabled in the browser. However when I look at it with spy, the select box is listed as enabled, valid and visible. How can I work out whether it is disabled or not?

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

Re: Disabled select box showing as enabled

Post by Support Team » Tue Feb 07, 2012 1:26 pm

Hi,

Have you tried to use the disabled attribute in the RxPath?
It is possible to get the attribute, even when it is not suggested by Ranorex.

Code: Select all

select[@id='LocationId' and @disabled='True']
Regards,
Tobias
Ranorex Support Team
.
Image

anzacthecat
Posts: 31
Joined: Mon Jan 10, 2011 1:05 pm

Re: Disabled select box showing as enabled

Post by anzacthecat » Tue Feb 07, 2012 1:53 pm

That works. Thanks!