title: Getting error : org.openqa.selenium.WebDriverException: unknown error: keys should be a string
body: <p>I am getting the error to access the data from the properties file in my selenium UI : How can this be solved ?</p>
  
  <pre><code>org.openqa.selenium.WebDriverException: unknown error: keys should be a string.
  </code></pre>
  
  <p>I have the following framework. I made it for my self for ease, looks like complicating myself. If any good ideas to better it, please suggest.
  Appreciate all suggestions.</p>
  
  <p>Framework contains the following :<br>
  1. <strong>config properties file</strong><br>
  2. <strong>utilities class</strong><br>
  3. <strong>Page elements definition class file</strong><br>
  4. <strong>reusable functions class file</strong><br>
  5. <strong>test classes</strong>  </p>
  
  <p><code>config.properties</code> file has the following content :</p>
  
  <pre><code>url=http://some.com
  Email=someuser
  Password=somepassword
  </code></pre>
  
  <p><strong>Utilities</strong> class (<code>BrowserCalls</code>) the following code :</p>
  
  <pre><code>import org.openqa.selenium.WebDriver;
  import org.openqa.selenium.chrome.ChromeDriver;
  import java.io.File;
  import java.io.FileInputStream;
  import java.io.IOException;
  import java.util.Properties;
  
  public class BrowserCalls {
  
      public WebDriver driver;
      public Properties configs = new Properties();
      public String pathToProperties = "path to config.properties file";
  
      public void invokeChromeBrowser() throws IOException {
  
          FileInputStream input = new FileInputStream(pathToProperties);
          pmsConfigs.load(input);
          System.setProperty("webdriver.chrome.driver", configs.getProperty("chromepath"));
          driver = new ChromeDriver();
          getAndMazimize();
  
      }
  
      private void getAndMazimize(){
  
          driver.get(configs.getProperty("url"));
          driver.manage().window().maximize();
  
      }
  
  
      public void closeChromeBrowser(){
  
          if(driver != null){
  
              driver.close();
          }
  
      }
  
  
  }
  </code></pre>
  
  <p>Page elements definition class file has the following code :</p>
  
  <pre><code>import org.openqa.selenium.By;
  
  public class LoginPageElements {
  
  
      //Login page elements
      public static By element1 = By.xpath("/html/head/link[1]");
      public static By username = By.xpath("//*[@id=\"login\"]/input/tr1/td1");
      public static By password = By.xpath("//*[@id=\"login\"]/input/tr2/td1");
      public static By submitButton = By.xpath("//*[@id=\"login\"]/input/tr3/td2/button");
      public static By title = By.xpath("/html/head/title");
  
  }
  </code></pre>
  
  <p>Functionality definition classes to be called by test case classes :</p>
  
  <pre><code>import com.automation.PageElements.LoginPageElements;
  import com.automation.ReusableFunctions.BrowserCalls;
  
  public class LoginFeature extends BrowserCalls {
  
      public void userLogin(){
  
          driver.findElement(LoginPageElements.element1);
          driver.findElement(LoginPageElements.username).sendKeys(configs.getProperty(Email));
          driver.findElement(LoginPageElements.password).sendKeys(configs.getProperty(Password));
          driver.findElement(LoginPageElements.submitButton).click();
  
      }
  
  }
  </code></pre>
  
  <p>Test Case class is as below :</p>
  
  <pre><code>import com.automation.ReusableFunctions.BrowserCalls;
  import com.automation.Components.LoginFeature;
  import org.testng.annotations.Test;
  
  import java.io.IOException;
  
  public class LoginTestCase1 extends BrowserCalls {
  
      @Test (description = "Verify application login")
      public void LoginTest() throws IOException {
  
          LoginFeature login = new LoginFeature();
          login.invokeChromeBrowser();
          login.userLogin();
          login.closeChromeBrowser();
  
      }
  
  }
  </code></pre>