Hi,

I'm working on a test that attempts to verify if certain visual characteristics 
are valid on the page as displayed.

Here's the scenario:
Normally a given button control on the page has a particular look if it's 
element class is set to "Button".
The HTML for this is <A class="Button" id="LogoutButton" 
onclick="logout();return false" 
href="http://machine/app/MenuBar.htm#";>Logout</A>

In another situation based on some settings in the application the same button 
has its element class set to "LogoutOverride Button".
The HTML for this is <A class="LogoutOverride Button" id="LogoutButton" 
onclick="logout();return false" 
href="http://machine/app/MenuBar.htm#";>Logout</A>

BTW, these lines just so happen to be enclosed by a <DIV> tag if this is 
relevant.

When the class of the button is "LogoutOverride Button" there is a link to an 
associated style sheet file that changes the button imagery to a different 
background image (a different image filename).  I want to verify that this 
imagery filename is in fact the file I am expecting so I want to query the 
style attributes associated with the above link element to provide an automated 
"visual" detection.

So far in IRB I have tried the following:

irb> puts f.divs[7].html

<DIV id=Logout><A class="LogoutOverride Button" id=LogoutButton 
onclick="logout();return false" href="#">Logout</A></DIV>
=> nil

irb> puts f.divs[7].links[1].style.ole_get_methods
[ ... lists all the style properties associated with this element ... ]
=> nil

irb> f.divs[7].links[1].style.backgroundImage 
=> ""

I wasn't expecting the last line to yield nothing, I thought it would yield the 
filename to the appropriate image.

IE Developer Toolbar in its list of style attributes for this element indicates 
that this link has the associated imagery against the property 
'background-image' with a value of 
'url("http://machine/app/css/blah/overridebutton.gif";)'.  This is what I 
thought I'd see with the last IRB line given above.

So what am I doing wrong here?  It looks as if most of the properties that I 
have inspected so far have yielded "" with the odd exception e.g. the 
accelerator property was correctly reported as being false.

Thanks for any help.

Regards,
Derek Wong.


_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to