what is the command for identifing the color of the object.
please help me ? my numberis 9916800532

Answers were Sorted based on User's Feedback



what is the command for identifing the color of the object. please help me ? my numberis 9916800532..

Answer / punj

Set Obj=browser().page().link()

obj.object.currentstyle.color

will give the color

Is This Answer Correct ?    1 Yes 0 No

what is the command for identifing the color of the object. please help me ? my numberis 9916800532..

Answer / messai

This method Object.currentStyle.color can be used for
any object to find the font color. You will get many
attributes falls under currentstyle

Is This Answer Correct ?    1 Yes 0 No

what is the command for identifing the color of the object. please help me ? my numberis 9916800532..

Answer / 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

More Automation Testing AllOther Interview Questions

How to capture Dos Promote data in text file? in that how to find particular String ( window )? in VB scrpting

0 Answers   Ness Technologies,


Hi, Below is the code that i ran on selenium RC using eclipse IDE and java coding.: package source; import org.testng.annotations.BeforeSuite; import org.testng.annotations.Test; import com.thoughtworks.selenium.*; public class parameterized extends SeleneseTestCase { private Selenium browser; public static void main(String []args) { String arr[] = new String[5]; arr[0]= "bert"; arr[1]= "regular"; arr[2]= "copyonly"; arr[3]= "doert"; arr[4]= "inter"; parameterized obj = new parameterized(); obj.setUp(); obj.login_parameterize(arr); } @BeforeSuite public void setUp() { browser = new DefaultSelenium("localhost",4444, "*chrome", "http://goolge.com"); browser.start(); browser.open("http://goolge.com"); browser.waitForPageToLoad("30000"); browser.windowMaximize(); browser.open("/"); browser.click("gb_23"); } @Test public void login_parameterize(String[] arr ) { for(int i=0;i<=5;i++) { for(int j=0;j<=2; j++) { browser.type("//input[@id='Email']", arr[i]); browser.type("//input[@id='Passwd']", arr[i]); browser.click("//input[@id='signIn']"); browser.waitForPageToLoad("30000"); } } } public void EnterValuesIntoTextField_CheckWithGetValue() throws Exception { selenium.open("http://www.essaywriter.co.uk"); assertEquals("", selenium.getValue("id=textInput")); selenium.type("id=textInput", "Text In The Field"); assertEquals("Text In The Field", selenium.getValue("id=textInput")); } } When i ran this test i got an error which says: "Method login_parameterize requires 1 parameters but 0 were supplied in the @Test annotation." Any help is much appreciated. thank Gab

0 Answers  


What is Database Testing?

5 Answers   Covansys,


What is the Differnce between Client/Server Testing and Web Based Testing?

3 Answers   BirlaSoft,


Elaborate the fields in bug report in automated testing

0 Answers  






define primary key & secondary key?

2 Answers   Everest, Mind Tree,


What is the difference between close and quit command?

0 Answers  


what is the importance of action in QTP & When it need to use it ? I m getting it please expian it me with proper example.

0 Answers  


What are the different types of an automation tool that you are aware of?

0 Answers  


What is a critical bug in a testing field?

0 Answers  


how to read data from a csv file using Test complete functional tool..please can anyone post the code

5 Answers  


What are the main attributes of test automation?

0 Answers  


Categories