ruby - How to verify if colour of element changed on mouse hovering? -


if mouse hovered on 'ask question' button of https://stackoverflow.com/ website, colour of button changes yellow. if want make sure, if colour changes on mouse hover, how can achieve using selenium webdriver? couldn't find helpful in html dom.

i can hover mouse on element using move_to method don't know how check whether colour of button changes? think, i'll have check css style not sure how that.

use css_value, see documentation here. note background color property on <li>, not <a> in particular case.

btn_ask_question = driver.find_element(:css, '.nav.askquestion li') puts btn_ask_question.css_value('background-color')  driver.action.move_to(btn_ask_question).perform puts btn_ask_question.css_value('background-color') 

my output (rgba(255, 153, 0, 1) #ff9900, orange color):

rgba(119, 119, 119, 1)

rgba(255, 153, 0, 1)


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -