How to validate SpanTag Disable property.

Ask general questions here.
archana
Posts: 12
Joined: Fri Jan 06, 2012 2:14 pm

How to validate SpanTag Disable property.

Post by archana » Mon Aug 27, 2012 12:20 pm

Hi ,

I want to validate Span Tag is enable or disable property. As in Ranorex it always gives
SpanTag -> Enabled =TRUE .
Even though Span Tag control is disabled still It gives FALSE value for Enabled property.

So,how to check Disable property of Span Tag.

Thanks,
Archana

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: How to validate SpanTag Disable property.

Post by Support Team » Mon Aug 27, 2012 2:01 pm

Hi,

Which Ranorex version are you using?
How do you set the disable attribute? Can you send us the HTML script of that element?
A Ranorex Snapshot file would also be helpful.
Following link will show you how to generate a snapshot file:
Creating Ranorex Snapshot Files.

Thanks,
Markus
Ranorex Support Team

krstcs
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: How to validate SpanTag Disable property.

Post by krstcs » Mon Aug 27, 2012 2:08 pm

Archana,

More than likely this is an issue with the application under test, not Ranorex.

Some web apps (especially extjs) do not set the properties for enabled/disabled as they should. They instead use the stylesheet and classes to show the state.

You may need to check the tag's class property to determine the state.

archana
Posts: 12
Joined: Fri Jan 06, 2012 2:14 pm

Re: How to validate SpanTag Disable property.

Post by archana » Thu Aug 30, 2012 8:01 am

I got one way to find out enable /disable property of span Tag :-
Go to parent element(DIV TAG) of Span Tag
Check InnertHtml of DIVTAG
It shows disabled property there.

But still this is not full proof solution as this code changes as per browser like :-

For IE9 - InnerHtml of DIVTAG :-
<DIV style="BACKGROUND-COLOR: #fff; CURSOR: default" class=first_li jQuery16103834797309296775="80"><SPAN>Insert Term</SPAN></DIV>
<DIV style="BACKGROUND-COLOR: #fff; CURSOR: default" class=first_li jQuery16103834797309296775="81"><SPAN>Accept change</SPAN></DIV>
<DIV style="BACKGROUND-COLOR: #fff; CURSOR: default" class=first_li jQuery16103834797309296775="82"><SPAN>Reject change</SPAN></DIV>

For Mozilla-InnerHtml of DIVTAG :-
<div style="background-color: rgb(255, 255, 255); cursor: default;" disabled="" class="first_li"><span>Insert Term</span></div>
<div disabled="" class="first_li"><span>Accept change</span></div>
<div disabled="" class="first_li"><span>Reject change</span></div>


It will be great and very helpful for me if you can put some light on it.

krstcs
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: How to validate SpanTag Disable property.

Post by krstcs » Thu Aug 30, 2012 3:18 pm

Check the "class" property. As I said above, some javascript libraries change the class to reflect changes to the object, instead of changing the property directly.

Manually check the class with Spy to see if there is a change to the class when the status of the object (enabled/disabled) changes.
Shortcuts usually aren't...