what is the command for identifing the color of the object.
please help me ? my numberis 9916800532

Answers were Sorted based on User's Feedback



what is the command for identifing the color of the object. please help me ? my numberis 9916800532..

Answer / punj

Set Obj=browser().page().link()

obj.object.currentstyle.color

will give the color

Is This Answer Correct ?    1 Yes 0 No

what is the command for identifing the color of the object. please help me ? my numberis 9916800532..

Answer / messai

This method Object.currentStyle.color can be used for
any object to find the font color. You will get many
attributes falls under currentstyle

Is This Answer Correct ?    1 Yes 0 No

what is the command for identifing the color of the object. please help me ? my numberis 9916800532..

Answer / sayonita

e.g. You have a button colored. You want to get the color of the button. So the code will be:
WebElement ButtonColor=driver.findElement(r.getLocator("BtnColor")); //BtnColor is the element whose xpath I have mentioned in a properties file
String color=status.getCssValue("background-color"); //Captures the color and stores in a variable
System.out.println(color); //prints the color of the button
String hex = Color.fromString(color).asHex(); //convert this color code into hexadecimal format
System.out.println(hex); //print the color code and then you compare in your script

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Automation Testing AllOther Interview Questions

What are the frameworks available in rc?

0 Answers  


Can anybody tell me the open source automation testing tool for performance testing to test web based application.? pls reply its urgent.

1 Answers  


Do you know what is a xpath?

0 Answers  


Tell us how can you find if an element is displayed on the screen?

0 Answers  


How to write output data to a file (txt,csv,excel) using Test complete automation tool?

2 Answers  






how to test web application

1 Answers  


Tell us the difference between assert and verify commands?

0 Answers  


Simplify the term defect severity.

0 Answers  


Does the Jmeter will generate any scripts? and anybody suggest with an example. how to use the Jmeter tool and also the How to anayse the Results?

2 Answers  


hi, I want to study TIA portla V11. where can I get online courses?

0 Answers  


Write a short compiled module which selects random numbers. and what function is used to call your customized compiled module?

0 Answers  


How to download QTP 9.5 Trail version? please explain the complete process?

0 Answers  


Categories