title: Not able to automate entering login credentials in Username and Password input fields
body: <p>I am writing scripts for automating login action with credentials . I followed the standard process of finding the element through name , class , xpath . The input fields are not taking the credentials . I tried giving time interval of 10 seconds  in between each process , still the issue continues.  </p>
  
  <p>Below I have attested the code . </p>
  
  <pre><code>from selenium import webdriver
  from selenium.webdriver.common.by import  By
  from selenium.webdriver.common.action_chains import ActionChains
  from selenium.webdriver.support.select import Select
  from selenium.webdriver.common.keys import Keys
  import time
  
  
  driver = webdriver.Firefox()
  
  driver.get()   #WEBSITE HERE
  
  time.sleep(10)
  
  elem = driver.find_element_by_xpath('//*[@id="ssousernameUI"]')
  
  elem.clear()
  elem.send_keys()  # USERNAME HERE
  
  elem.send_keys(Keys.RETURN)
  
  time.sleep(10)
  
  passwd = driver.find_element_by_xpath('//*[@id="password"]')
  
  passwd.clear()
  
  passwd.send_keys()  #PASSWORD HERE
  
  passwd.send_keys(Keys.RETURN)
  
  time.sleep(10)
  
  login = driver.find_element_by_link_text("Login")
  
  login.click()
  </code></pre>
  
  <p>ERROR MESSAGE :</p>
  
  <pre><code>  Traceback (most recent call last):
    File "/home/think201/PycharmProjects/pat/pat-cbt/login.py", line 13, 
    in &lt;module&gt;
  elem = driver.find_element_by_xpath('//*[@id="ssousernameUI"]')
  
  
    File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/webdriver.py", line 368, in find_element_by_xpath
  return self.find_element(by=By.XPATH, value=xpath)
  
  
  
    File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/webdriver.py", line 858, in find_element
  'value': value})['value']
  
  
  
    File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/webdriver.py", line 311, in execute
  self.error_handler.check_response(response)
  
  
  
  
    File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/errorhandler.py", line 237, in check_response
  
  
  
  raise exception_class(message, screen, stacktrace)
  selenium.common.exceptions.NoSuchElementException: Message: Unable to 
  locate element: //*[@id="ssousernameUI"]
  </code></pre>
  
  <p>HTML code </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>          
           &lt;form name="loginForm" action="https://login.asdfghjk.in/oam/server/auth_cred_submit" target="_top" id="loginForm" method="POST"&gt;   
     
  &lt;!-- Taksh End --&gt;
  
  &lt;input name="ipRandomValue" value="709381701517861" id="ipRandomValue" type="hidden"&gt;&lt;input name="deviceTypeHidden" value="Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:57.0) Gecko/20100101 Firefox/57.0" id="deviceTypeHidden" type="hidden"&gt;
  &lt;input name="ssousername" value="" id="ssousername" type="hidden"&gt;
  &lt;input name="hashnumber" value="" id="hashnumber" type="hidden"&gt; 
  
  
  &lt;!-- Start mainWrapper --&gt;
  &lt;div class="overlay"&gt;&lt;/div&gt;
  &lt;div style="top: 20%;left: 50%;position: fixed;z-index: 5;color: white;display:none;" class="wait"&gt;
      &lt;h1&gt;Please wait...&lt;/h1&gt;
  &lt;/div&gt;
  
  &lt;div class="overlay1"&gt;&lt;/div&gt;
  &lt;div class="mainWrapper"&gt; 
    &lt;!-- Start Header --&gt;
    
    
    &lt;!-- End Header --&gt; 
    
    &lt;!-- Start Middle Container --&gt;
    &lt;article class="midContainer"&gt;
      &lt;div class="container"&gt;
        &lt;div class="breadcrums"&gt;
          &lt;p&gt;You are here:&lt;/p&gt;
          &lt;ul&gt;
            &lt;li&gt;&lt;a href="javascript:;"&gt;Home&lt;/a&gt;&lt;/li&gt;
            &lt;li class="last"&gt; Login&lt;/li&gt;
          &lt;/ul&gt;
        &lt;/div&gt;
        &lt;h1&gt; Login&lt;/h1&gt;
        &lt;section class="RHSsection standardWide"&gt;
          &lt;div class="pageWrap"&gt;
            &lt;div class="loginWrp"&gt;
              &lt;div class="box vfAcc"&gt;
              
              &lt;!-- displaying error message --&gt;
              &lt;div class="cl c414042 bold fnt16"&gt;&lt;p style="color:red;margin-left:10px;"&gt;&lt;br&gt;&lt;strong class="errMsgClass"&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/div&gt;
              &lt;div class="cl c414042 bold fnt16" id="SrvError"&gt;&lt;/div&gt;
              &lt;div style="display:none;" class="cl c414042 bold fnt16 lockClass"&gt;&lt;p style="color:red;margin-left:10px;"&gt;&lt;br&gt;&lt;strong&gt;Your account is locked since it is 
  not used for a long time. Please &lt;a href="https://qwertyu.in/CSSPortal/faces/oracle/webcenter/portalapp/pages/forgotPassword.jspx"&gt;click here &lt;/a&gt; to activate it&lt;/strong&gt;&lt;/p&gt;&lt;/div&gt;
                 
              &lt;!-- displaying error message end --&gt;
                
                &lt;h3 class="accor"&gt;Login to manage your Account &lt;span class="drop"&gt;&lt;/span&gt;&lt;/h3&gt;
                &lt;div class="setWrp"&gt;
                  &lt;div class="row"&gt;
                    &lt;label&gt;Enter your username or mobile number&lt;/label&gt;
                    &lt;div class="inputArea"&gt;
                      &lt;div class="inputFieldBox"&gt;
                      
                      
                       &lt;input name="ssousernameUI" autocomplete="off" class="login_input width255" value="" onfocus="if
  (this.value==this.defaultValue)this.value='';" id="ssousernameUI" onblur="if(this.value=='')this.value=this.defaultValue;" type="text"&gt;
                            &lt;div class="error_msg"&gt;&lt;/div&gt;                  
                      &lt;/div&gt;
                   &lt;/div&gt; 
                    
                  &lt;/div&gt;
                  &lt;div class="row"&gt;
                    &lt;label&gt;Enter your password&lt;/label&gt;
                    &lt;div class="inputArea"&gt;
                      &lt;div class="inputFieldBox"&gt;
                        
                        &lt;input name="password" autocomplete="off" id="password" class="login_input width255" onkeydown="if ((event.keyCode == 
  13) &amp;amp;&amp;amp; (document.getElementById('ssousernameUI').value!='') &amp;amp;&amp;amp; (document.getElementById('passwordsrv').value!='')){LoginValidation();}" onblur="if(this.value=='')this.value=this.defaultValue;" value="" onfocus="if
  (this.value==this.defaultValue)this.value='';" type="password"&gt;
                           &lt;div class="error_msg"&gt;&lt;/div&gt;                    
                      &lt;/div&gt; 
                     &lt;/div&gt;
                  &lt;/div&gt;
                  &lt;div class="row"&gt;
                    &lt;div class="checkboxBtn"&gt; &lt;span class="uncheked"&gt;&lt;/span&gt;
                      &lt;input name="checkbox" id="RememberMe" type="checkbox"&gt;
                      &lt;label for="RememberMe"&gt; Remember Me &lt;/label&gt;
                    &lt;/div&gt;
                    &lt;div class="forgot"&gt; &lt;a href="https://qwertyuio.in/CSSPortal/faces/oracle/webcenter/portalapp/pages/forgotPassword.jspx" onclick="ga('send', 'event', 'My Account', 'Click', 'Forgot Password'); utag.link({ Custom_Links : 'MyAccount: Login: Forgot Password' });"&gt;Forgot your password?&lt;/a&gt;&lt;/div&gt;
                  &lt;/div&gt;
                  
                  &lt;a href="javascript:;" onclick="ajaxLoginValidation();" class="purpleBtn"&gt;Login&lt;/a&gt;&lt;!-- Add Here : Taksh --&gt;
                  
                  
                &lt;!--  &lt;div class="col orline"&gt;&lt;span class="or"&gt;Or&lt;/span&gt;&lt;/div&gt;
                  &lt;ul class="smoShare"&gt;
                    &lt;li class="facebook"&gt;&lt;a href="javascript:;"&gt;Facebook&lt;/a&gt;&lt;/li&gt;
                    &lt;li class="gplus"&gt;&lt;a href="javascript:;"&gt;Google Plus&lt;/a&gt;&lt;/li&gt;
                  &lt;/ul&gt; --&gt;
                &lt;/div&gt;
              &lt;/div&gt;
              &lt;div class="box myvf"&gt;
                &lt;h3 class="accor"&gt;Why should I register ? &lt;span class="drop"&gt;&lt;/span&gt;&lt;/h3&gt;
                &lt;div class="setWrp"&gt;
                  &lt;p&gt;Here are 5 great reasons! &lt;/p&gt;
                  &lt;ul class="redbult"&gt;
                    &lt;li&gt;Simplified, dashboard view of voice &amp;amp; Internet usage&lt;/li&gt;
                    &lt;li&gt; Easy update of profile &amp;amp; contact info&lt;/li&gt;
                    &lt;li&gt; Quick change of voice &amp;amp; plans&lt;/li&gt;
                    &lt;li&gt; Hassle-free access to old bills &amp;amp; statements of accounts&lt;/li&gt;
                    &lt;li&gt; Instant activation/deactivation of services&lt;/li&gt;
                  &lt;/ul&gt;
                  &lt;p&gt;It takes just a few moments!&lt;/p&gt;
                  &lt;a href="https://qwertyuio.in/CSSPortal/faces/oracle/webcenter/portalapp/pages/Registration.jspx" onclick="ga('send', 'event', 'My Account', 'Click', 'Register Now'); utag.link({ Custom_Links : 'MyAccount: Login: Register Now', Internal_Journey : 'MyAccount Login: My VF Registration'});" class="purpleBtn"&gt;Register Now&lt;/a&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
              &lt;div class="box vfApp"&gt;
                &lt;h3 class=""&gt; App&lt;/h3&gt;
                &lt;div class=""&gt;
                  &lt;div class="vfappSlide"&gt;
                    &lt;div class="owl-vfapp owl-carousel owl-theme owl-loaded"&gt;
                      
                      
                  &lt;!--    &lt;div class="apps"&gt; &lt;img src="/images/appimages/windows_logo.jpg"  alt="" /&gt;
                        &lt;p&gt;Manage your account on the go !&lt;/p&gt;
                          &lt;div class="getNow"&gt;&lt;a onclick="ga('send', 'event', 'My Account', 'Click', 'Windows - Get Now'); utag.link({ Custom_Links : 'MyAccount: Login: windows App - Get Now' });" href="http://qwertyu" class="purpleBtn"&gt;Get Now&lt;/a&gt; &lt;/div&gt;
                      &lt;/div&gt;
                      &lt;div class="apps"&gt; &lt;img src="/images/appimages/blackberry_logo.png"  alt="" /&gt;
                        &lt;p&gt;Manage your Vodafone account on the go !&lt;/p&gt;
                        &lt;div class="getNow"&gt;&lt;a onclick="ga('send', 'event', 'My Account', 'Click', 'Blackberry - Get Now'); utag.link({ Custom_Links : 'MyAccount: Login: Blackberry App - Get Now' });" href="http://qwerty" class="purpleBtn"&gt;Get Now&lt;/a&gt; &lt;/div&gt;
                        &lt;/div&gt;
                        &lt;div class="apps"&gt; &lt;img src="/images/appimages/nokia_ovi_logo.jpg"  alt="" /&gt;
                        &lt;p&gt;Manage your account on the go !&lt;/p&gt;
                         &lt;div class="getNow"&gt;&lt;a onclick="ga('send', 'event', 'My Account', 'Click', 'OVI - Get Now'); utag.link({ Custom_Links : 'MyAccount: Login: Ovi App - Get Now' });" href="http://qwertyu" class="purpleBtn"&gt;Get Now&lt;/a&gt; &lt;/div&gt;                      
                         &lt;/div&gt;
                        &lt;div class="apps"&gt; &lt;img src="/images/appimages/java_logo.jpg"  alt="" /&gt;
                        &lt;p&gt;Manage your account on the go !&lt;/p&gt;
                         &lt;div class="getNow"&gt;&lt;a onclick="ga('send', 'event', 'My Account', 'Click', 'Java - Get Now');utag.link({ Custom_Links : 'MyAccount: Login: Java App - Get Now' });" href="http://qwertyui" class="purpleBtn"&gt;Get Now&lt;/a&gt; &lt;/div&gt;
                         &lt;/div&gt; --&gt;
                    &lt;div class="owl-stage-outer"&gt;&lt;div class="owl-stage" style="transform: translate3d(-837px, 0px, 0px); transition: all 0.25s ease 0s; width: 1674px;"&gt;&lt;div class="owl-item cloned" style="width: 279px; margin-right: 0px;"&gt;&lt;div class="apps"&gt; &lt;img alt="" src="/images/appimages/android_logo1.jpg"&gt;
                        &lt;p&gt;Manage your Vodafone account on the go !&lt;/p&gt;
                          &lt;div class="getNow"&gt;&lt;a href="http://asdfgh" onclick="ga('send', 'event', 'My Account', 'Click', 'Android - Get Now'); utag.link({ Custom_Links : 'MyAccount: Login: Android App - Get Now' });" class="purpleBtn"&gt;Get Now&lt;/a&gt; &lt;/div&gt;
                          &lt;/div&gt;&lt;/div&gt;&lt;div class="owl-item cloned" style="width: 279px; margin-right: 0px;"&gt;&lt;div class="apps"&gt; &lt;img alt="" src="/images/appimages/apple_logo1.jpg"&gt;
                        &lt;p&gt;Manage your Vodafone account on the go !&lt;/p&gt;
                         &lt;div class="getNow"&gt;&lt;a href="http://qwertyu" onclick="ga('send', 'event', 'My Account', 'Click', 'Apple - Get Now'); utag.link({ Custom_Links : 'MyAccount: Login: iphone App - Get Now' });" class="purpleBtn"&gt;Get Now&lt;/a&gt; &lt;/div&gt;
                       
                      &lt;/div&gt;&lt;/div&gt;&lt;div class="owl-item" style="width: 279px; margin-right: 0px;"&gt;&lt;div class="apps"&gt; &lt;img alt="" src="/images/appimages/android_logo1.jpg"&gt;
                        &lt;p&gt;Manage your Vodafone account on the go !&lt;/p&gt;
                          &lt;div class="getNow"&gt;&lt;a href="http://asdfghj" onclick="ga('send', 'event', 'My Account', 'Click', 'Android - Get Now'); utag.link({ Custom_Links : 'MyAccount: Login: Android App - Get Now' });" class="purpleBtn"&gt;Get Now&lt;/a&gt; &lt;/div&gt;
                          &lt;/div&gt;&lt;/div&gt;&lt;div class="owl-item active" style="width: 279px; margin-right: 0px;"&gt;&lt;div class="apps"&gt; &lt;img alt="" src="/images/appimages/apple_logo1.jpg"&gt;
                        &lt;p&gt;Manage your  account on the go !&lt;/p&gt;
                         &lt;div class="getNow"&gt;&lt;a href="http://asdfghjk" onclick="ga('send', 'event', 'My Account', 'Click', 'Apple - Get Now'); utag.link({ Custom_Links : 'MyAccount: Login: iphone App - Get Now' });" class="purpleBtn"&gt;Get Now&lt;/a&gt; &lt;/div&gt;
                       
                      &lt;/div&gt;&lt;/div&gt;&lt;div class="owl-item cloned" style="width: 279px; margin-right: 0px;"&gt;&lt;div class="apps"&gt; &lt;img alt="" src="/images/appimages/android_logo1.jpg"&gt;
                        &lt;p&gt;Manage your  account on the go !&lt;/p&gt;
                          &lt;div class="getNow"&gt;&lt;a href="http://asdfghjk" onclick="ga('send', 'event', 'My Account', 'Click', 'Android - Get Now'); utag.link({ Custom_Links : 'MyAccount: Login: Android App - Get Now' });" class="purpleBtn"&gt;Get Now&lt;/a&gt; &lt;/div&gt;
                          &lt;/div&gt;&lt;/div&gt;&lt;div class="owl-item cloned" style="width: 279px; margin-right: 0px;"&gt;&lt;div class="apps"&gt; &lt;img alt="" src="/images/appimages/apple_logo1.jpg"&gt;
                        &lt;p&gt;Manage your  account on the go !&lt;/p&gt;
                         &lt;div class="getNow"&gt;&lt;a href="" onclick="ga('send', 'event', 'My Account', 'Click', 'Apple - Get Now'); utag.link({ Custom_Links : 'MyAccount: Login: iphone App - Get Now' });" class="purpleBtn"&gt;Get Now&lt;/a&gt; &lt;/div&gt;
                       
                      &lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="owl-controls"&gt;&lt;div class="owl-nav"&gt;&lt;div class="owl-prev" style="display: none;"&gt;prev&lt;/div&gt;&lt;div class="owl-next" style="display: none;"&gt;next&lt;/div&gt;&lt;/div&gt;&lt;div style="" class="owl-dots"&gt;&lt;div class="owl-dot"&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="owl-dot active"&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
                  &lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/section&gt;
      &lt;/div&gt;
    &lt;/article&gt;
    
    
    &lt;!-- End Middle Container --&gt; 
    
  &lt;/div&gt;
  &lt;!-- End mainWrapper --&gt;
  &lt;/form&gt;</code></pre>
  </div>
  </div>
  </p>