title: Selenium API is Not working when I publish on IIS
body: <p>I'm trying to scrape one website by API. If I run API Project and test then it's working fine but I publish on IIS it threw me an error like <strong>Object reference not set to an instance of an object.</strong></p>
  <p>If I'm using another website with the same API it's working fine.</p>
  <pre><code>driver.Navigate().GoToUrl(&quot;my url&quot;);
                
  var UserName = getElement(By.XPath(&quot;//input[contains(@name,'txtEmail')]&quot;));
  if (UserName != null) UserName.Clear(); UserName.SendKeys(login);
  Error = Error + &quot;\nUser ctrl found&quot;;
              
  var PSW = getElement(By.XPath(&quot;//input[contains(@name,'txtPassword')]&quot;));
  if (PSW != null) PSW.Clear(); PSW.SendKeys(pwd);
  Error = Error + &quot;\nPSW ctrl found&quot;;
  
  var Login = getElement(By.XPath(&quot;//button[contains(text(),'Login')]&quot;));
  if (Login != null) Login.Click();
  Error = Error + &quot;\nClick ctrl found&quot;;
  </code></pre>
  <p>can anyone help me with my query?</p>