RE: Interview Question

I have a textbox, button and a lable.

The requirement is, If I enter any text color (ex: green) and click the button. Then the lable shall fill the color with green.

Depending upon the color entering in the textbox, the lable shall fill with that respective color.

Can anybody let me know the Selenium WebDriver code in Java.

Add Comment
3 Answers

String str = “green”;
String strx = ┬ádriver.findElement(“lable”)).getCSSValue(“background-color”);
if (str.equals(strx)){
// test case passed

Supporter Answered on July 21, 2015.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.