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
Explain me how to check if an element is visible on the page?
What is the purpose of deselectall() method?
how to know whether the user information or any other information which is entered in to the web is storing in secured place or non secured place?
Tell us what automation tools could be used for post-release validation with continuous integration?
Is ui level testing possible?
How many test cases have you automated per day?
Can you do without a framework?
explain add in manager and virtual object wizard in winrunner
What COM Interfaces u r using in QTp While Connecting QC or TD? Or in QTP?Any body plz urgent...
What are the risks associated in automation testing?
Tell me what is regression testing?
Tell me how can we find the value of different attributes like name, class, value of an element?
Can we prioritize tests in Junit. What is the sequence of execution in Junit?
Name the frameworks that are used in software automation testing?
Give some examples for performance test tools?