watir-webdriver: Validating the Color of an element

Showing 1-6 of 6 messages
watir-webdriver: Validating the Color of an element hillary 8/8/11 11:34 AM
When there's an error, the application i'm testing changes the color of the element, a text_field, changes to red. Currently I validate that the text_field is red like this: 
b.text_field(:id, "text_field").document.currentstyle.color.should == '#444' 

I also will did to validate the color of a div message that tells the user that changes have been saved. i use the document.currentstyle.color for this also. 

Thanks. 
Re: [wtr-general] watir-webdriver: Validating the Color of an element Jari Bakken 8/8/11 11:43 AM
WebDriver doesn't give direct access 
Re: [wtr-general] watir-webdriver: Validating the Color of an element Jari Bakken 8/8/11 11:45 AM
WebDriver doesn't give direct access to the underlying DOM object like other implementations. Instead you can use b.text_field(:id, "text_field").style("color"). 


Den 8. aug. 2011 kl. 20:34 skrev hillary <weima...@gmail.com>:

Re: [wtr-general] watir-webdriver: Validating the Color of an element hillary 8/8/11 12:38 PM
Thanks. 

Just to confirm, the color would be it's html value (#444), so it'd be .style("#444")? 
Re: [wtr-general] watir-webdriver: Validating the Color of an element Jari Bakken 8/8/11 12:46 PM
No, .style returns the value of the given CSS property. So .style("color").should == "#444". 


Den 8. aug. 2011 kl. 21:38 skrev hillary <weima...@gmail.com>:

Thanks. 

Just to confirm, the color would be it's html value (#444), so it'd be .style("#444")? 

--
Before posting, please read http://watir.com/support. In short: search before you ask, be nice.
 
watir-...@googlegroups.com
http://groups.google.com/group/watir-general
watir-genera...@googlegroups.com
Re: [wtr-general] watir-webdriver: Validating the Color of an element hillary 8/8/11 12:52 PM
Okay. Thanks.