Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Explain me how to check if an element is visible on the page?

978


What is the purpose of deselectall() method?

1036


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?

2092


Tell us what automation tools could be used for post-release validation with continuous integration?

1040


Is ui level testing possible?

1015


How many test cases have you automated per day?

1024


Can you do without a framework?

1058


explain add in manager and virtual object wizard in winrunner

2174


What COM Interfaces u r using in QTp While Connecting QC or TD? Or in QTP?Any body plz urgent...

1961


What are the risks associated in automation testing?

1152


Tell me what is regression testing?

1037


Tell me how can we find the value of different attributes like name, class, value of an element?

1016


Can we prioritize tests in Junit. What is the sequence of execution in Junit?

1992


Name the frameworks that are used in software automation testing?

963


Give some examples for performance test tools?

1057