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 is testng and why is it better than junit?
Tell us what automation tools could be used for post-release validation with continuous integration?
List down the primary features of a good automation tool?
Could any one share scripts... where we can Parameterize radio buttons and Check boxes in Rational Robot.
you have same applications (same server configaration)A&B you are doing nonfunctionality testing . what they differ in?
Currently I do not have any automation in place in my project, but now I want to implement automation, what would be my steps?
What are the frameworks available in rc?
What is difference between selenium and QTP tools Which is best tool... Which is most used tool
What are pros and cons of automating tests at ui layer?
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.
In Selenium how a test suit is run and report is generated.
1.Which functinalities of QTP using in onlinebanking system? 2.in lift which kind of testing you perform? 3.how do you test money is transform from one account to another account in online banking?
How can the user get a text of a web element?
Explain me what kinds of annotations are used in testng?
How do we Test the C++ and Unix Application Using Automated Tool.