1> What does highlighted text means?
Suppose you browse any page , select any text on that page using mouse or some other means. Let say "" , "Sign Up "text is highlighted. Please correct my understanding if its wrong.
2> I tried the below code to get CssValue of color and background-color. Using the given code:
driver.get("https://facebook.com");
String textColor = driver.findElement(By.xpath("//*[@id='pageFooter']/div[3]/div/span")).getCssValue("color");
String bkgColor = driver.findElement(By.xpath("//*[@id='pageFooter']/div[3]/div/span")).getCssValue("background-color");
System.out.println("TextColor : " + textColor );
System.out.println("Background Color : " + bkgColor);
output:-
TextColor : rgba(115, 115, 115, 1)
Background Color : transparent
*TextColor gives the color of text.
** For highlighting i am using Robot class to send Ctrl+A , though its selecting entire page, but it should output some different value. In that case also it's giving the text color only as above output.
Please let me know if i am doing right or is my understanding about highlighted text is correct.