title: Find out if class name contains certain text
body: <p>As part of my test, the system is supposed to find out if the device being used to open the website is a mobile device or a normal desktop.</p>
  
  <p>I keep getting the error:</p>
  
  <blockquote>
    <p>"InvalidSelectorError: Unable to locate an element with the xpath expression //*[contains(@class, is-mobile..."</p>
  </blockquote>
  
  <p>Property from firebug:</p>
  
  <pre><code>&lt;body class="login-page is-desktop"&gt;
  </code></pre>
  
  <p>My test:</p>
  
  <pre><code>public class isMobile {
  
  public static boolean isMobile = false;
  
  public static boolean checkIfMobile(WebDriver driver) throws Exception {
  
      List&lt;WebElement&gt; list = driver.findElements(By
              .xpath("//body[contains(@class, 'is-mobile'"));
      if (list == null) {
          return false;
      } else {
          return true;
      }
  }
  }
  </code></pre>
  
  <p>Can somebody please tell me how the correct XPath should be?</p>