title: How to convert Selenium IWebElement in Selenium Locator By C#?
body: <p>How to convert IWebElement in Locator Selenium WebDriver Page Objects?</p>
  
  <p>I work like this:</p>
  
  <pre><code>using OpenQA.Selenium.Support.PageObjects;
          [FindsBy(How = How.Id, Using = "user")]
          public IWebElement txtUser { get; set; }
  
          public void fillUserField(string user)
          {
             wait.Until(ExpectedConditions.ElementIsVisible(By.Id("user")));
             txtUser.SendKeys(user);
          }
  </code></pre>
  
  <p>I do not want to repeat the ID "user" in wait.</p>
  
  <p>I don't work like this:</p>
  
  <pre><code>    public void fillUserField(string user)
      {   // TO DO - Convert IWebElement in Locator (BY)
          //Argument1: Cannot convert from 'OpenQA.Selenium.IWebElement' to 'OpenQA.Selenium.By'  
          wait.Until(ExpectedConditions.**ElementIsVisible(txtUser)**);
          txtUser.SendKeys(user);
      }
  </code></pre>
  
  <p>Is possible? Thanks!</p>