Disabled select box showing as enabled : Automation API

Disabled select box showing as enabled

Class library usage, coding and language questions.

Disabled select box showing as enabled

Postby anzacthecat » Tue Feb 07, 2012 1: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?
anzacthecat
 
Posts: 29
Joined: Mon Jan 10, 2011 2:05 pm

Re: Disabled select box showing as enabled

Postby Support Team » Tue Feb 07, 2012 2: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
User avatar
Support Team
Site Admin
 
Posts: 4840
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria

Re: Disabled select box showing as enabled

Postby anzacthecat » Tue Feb 07, 2012 2:53 pm

That works. Thanks!
anzacthecat
 
Posts: 29
Joined: Mon Jan 10, 2011 2:05 pm


Return to Automation API

Who is online

Users browsing this forum: No registered users and 0 guests