title: How to send text into a angular input field after switching tabs using Selenium Python
body: <p>I am trying to input text into a Angular input field after switching tabs. I keep getting either:</p>
  <pre><code>AttributeError: 'tuple' object has no attribute 'send_keys'
  </code></pre>
  <p>error or</p>
  <pre><code>ElementClickInterceptedException
  </code></pre>
  <p>or</p>
  <pre><code>NoSuchElementException
  </code></pre>
  <p>I have also noticed that the <code>click()</code> command is no longer a method but say click: Any.</p>
  <p>Below is the HTML for the input field I am trying to input text into:</p>
  <pre><code>&lt;fieldset&gt;
      &lt;label&gt;Username:&lt;/label&gt;
      &lt;input ng-required=&quot;true&quot; ng-readonly=&quot;!hasPriviledgeToEdit(user)&quot; ng-model=&quot;user.loginId&quot; ng-pattern=&quot;/^[a-zA-Z0-9_]+$/&quot; name=&quot;loginId&quot; maxlength=&quot;16&quot; class=&quot;ng-pristine ng-untouched ng-invalid ng-invalid-required ng-valid-pattern ng-valid-maxlength&quot; required=&quot;required&quot;&gt;
      4-16 chars; A-z, 0-9, _
      &lt;!-- ngIf: userProfileForm.loginId.$error.required --&gt;&lt;span ng-if=&quot;userProfileForm.loginId.$error.required&quot; class=&quot;invalid warning ng-scope&quot;&gt;Required&lt;/span&gt;&lt;!-- end ngIf: userProfileForm.loginId.$error.required --&gt;
      &lt;!-- ngIf: userProfileForm.loginId.$error.pattern --&gt;
  &lt;/fieldset&gt;
  </code></pre>
  <p>Below is the code:</p>
  <pre><code>from multiprocessing.connection import wait
  import time
  from webbrowser import Chrome
  from xml.etree.ElementPath import find
  
  from selenium import webdriver
  from selenium.webdriver.chrome.options import Options
  from selenium.webdriver.common.by import By
  from selenium.webdriver.support import expected_conditions as EC
  from selenium.webdriver.support.ui import WebDriverWait
  from selenium.common.exceptions import NoSuchElementException
  
  driver = webdriver.Chrome()
  driver.get('https://power.dat.com')
  
  # chrome_optinons = webdriver.ChromeOptions()
  # chrome_optinons.add_argument('--headless')
  # chrome_optinons.add_argument('window-size=1920x1080')
  
  #setup wait 
  wait = WebDriverWait(driver, 10)
  
  username = driver.find_element(By.XPATH, '//*[@id=&quot;mat-input-1&quot;]')
  username.send_keys('')
  
  password = driver.find_element(By.XPATH, '//*[@id=&quot;mat-input-0&quot;]')
  password.send_keys('')
  
  
  loginbutton = driver.find_element(By.XPATH, '//*[@id=&quot;submit-button&quot;]')
  loginbutton.click()
  
  (time.sleep(5))
  
  profiledrop = driver.find_element(By.XPATH, '//*[@id=&quot;user-salutation&quot;]')
  profiledrop.click()
  
  #store original window ID
  original_window = driver.current_window_handle
  
  #checks no other windows open
  assert len(driver.window_handles) == 1
  
  
  Adminbutton = driver.find_element(By.CSS_SELECTOR, '#userPreferencesUl &gt; li:nth-child(5) &gt; a')
  Adminbutton.click()
  
  
  # driver.switch_to.window(driver.window_handles[1])
  
  #Wait for new window Tab
  wait.until(EC.number_of_windows_to_be(2))
  
  #loops through till new window is confirmed open
  for window_handle in driver.window_handles:
      if window_handle != original_window:
          driver.switch_to.window(window_handle)
          break
  
  #Tells program to wait till new window confirmed 
  wait.until(EC.title_is(&quot;Admin&quot;))
  
  
  NewUsrBtn = WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.CSS_SELECTOR, &quot;button.newUser.ng-scope[ng-if^='isTrustedAdmin'][ng-click^='onNewUser']&quot;)))
  NewUsrBtn.click()
  
  
  UsrNM = driver.find_element(By.XPATH, &quot;//input[@name='loginId']&quot;)
  UsrNM.send_keys('justin')
  </code></pre>
  <p>If you can explain how to get the proper Xpath for this element and if there is anything I need to do to make sure the driver continues to point to the new tab.</p>
  <p>I have tried the below paths:</p>
  <pre><code>//input[@name='loginId']
  
  input[name='loginId']
  
  //*[@id=&quot;data&quot;]/div[3]/table/tbody[1]/tr/td[1]/ng-form/fieldset[1]/input
  
  #data &gt; div.fixed-table-container-inner &gt; table &gt; tbody:nth-child(2) &gt; tr &gt; td:nth-child(1) &gt; ng-form &gt; fieldset:nth-child(1) &gt; input
  </code></pre>