title: Obtaining the color of button/layout/element
body: <p>Similiar questions were very old so I post a new one.
  I need to get the color of the layout and I tried previous responses, but i. e.:</p>
  
  <ul>
  <li><p>I can't invoke the findViewById method, it gets colored in red in my IDE,</p></li>
  <li><p>I don't have a particular ID for a layout, only index; id's are the same for similar items in the app,</p></li>
  <li><p>I need to verify the colors of background for search results which are different for specific searches,</p></li>
  <li><p>can't use getCssValue since I get an error that method has not been implemented yet.</p></li>
  </ul>
  
  <p>How can I deal with that?</p>
  
  <p>Screenshot from the app, need to verify only the color of search result (example titled 'D41').
  <a href="https://i.imgur.com/BqMic5E.png" rel="nofollow noreferrer">https://i.imgur.com/BqMic5E.png</a></p>
  
  <p>Sample code of a test, which doesn't work with getCssValue:</p>
  
  <p><code>@Test public void searchOperatorSign01() { 
  driver.findElementById("search_button").click(); driver.findElementByXPath("//android.widget.TextView[@text='‌​OperatorsWithSigns1'‌​]").click(); driver.findElementByXPath("//android.widget.EditText[@index=‌​'2']").sendKeys("D41‌​"); driver.findElementById("search_mask").click();
  String cssVal = driver.findElementByXPath("//android.widget.RelativeLayout[@‌​index='0']").getCssV‌​alue("background-col‌​or")</code></p>