lomer
lomer

Reputation: 51

How can i test the color of the Text or the image css changes in my test case?

I am using selenium. ( i am using Firefox and IDE). My testcase is to test whether Color of toolbar of my webpage got changed or not? using the selenium IDE it just gives me option to 'verifyText' but not color. Is there a way it can read the css changes that i want to test ?

I am not a programmer . I have limited programming knowledge so i was wondering if probably selenium is not the right tool for me. DO you think Watir will work better in testing this type of cases?. Can i use Watir with some recorders to create testcases?

Thanks! Any reply to my query will be highly appreciated.

Upvotes: 3

Views: 5844

Answers (1)

rs79
rs79

Reputation: 2321

  1. Using CSS identifiers, try retrieving the color attribute for your toolbar.
  2. Simply assert for the presence of that element, using the color as the descriptor.

Here's an example: For the webpage, http://www.w3schools.com/css/css_colors.asp, the assertion for the Red color would be assertTrue(selenium.isElementPresent("css=td[bgcolor=#ff0000]"));

Upvotes: 4

Related Questions