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 pre-requisites to start automation testing?
What is functional and regression testing?
How could you explain the main difference between webdriver and rc?
Any one suggest me for Free ware (Opensource) Automation tool for regression testing.
Can you explain data-driven testing?
Hi, I want to learn DataBase Testing. So please some document or path so that i can get some material on DataBase Testing concepts (preferably SQL Server 2000). Thanks in advance, Guru
What is a ‘test plan’? What is a ‘test case’?
What is an automation testing framework?
What are the steps involved in the automation process ?
is anybody suggest me which one is the best testing institute in ameerpet hydrabad
How to select an automation tool best matched for your project?
Write a short compiled module which selects random numbers. and what function is used to call your customized compiled module?
When will you not automate testing?
how to import specifically 2nd column elements to runtime datatable in excel sheet if it contains 3 columns
Can we prioritize tests in Junit. What is the sequence of execution in Junit?