what is the command for identifing the color of the object.
please help me ? my numberis 9916800532
Answer Posted / 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 View All Answers
What are the different types of an automation tool that you are aware of?
what are the questions that are generally asked in an interview if a person is having 3-4 years of exp..and in ds exp 2 yrs exp is wd automation testing
Please name a couple of standard web function found in the function generator?
What are the different types of locks in mainframe?
Elaborate the fields in bug report in automated testing
if i want to use different values in datatable with each iteration of for loop what would i do ??/
HOW CAN WINRUNNER AND TEST DIRECTOR CONNECTED TO THE DATABASE AND WHAT R THE OPTIONS?
What are the primary features of good automation tool ?
Kindly let me know how to setup JMeter for functionality testing of a Web application.. The apache help doc is good but i m little confused with it... :(
Tell us what methods of robot class do you know?
On Test Complete I recorded some keyword test. while I'm running the batch test, if one test case failed, then how test complete skip the failed test case and again continue to run the test case? please provide some way to resolve this issue.
How would you test your own element locator?
can any one tell me the examples of white box testing
Can any one give me the script for drag and drop or setselection functions ?like in a not pad i want to select 5 lines
why we cannot apply check points in compile modules?