title: Tkinter AssertionError: Python3 Web App using selenium won't input search term in driver.title
body: <p>I have been learning python for the past 10 months; I am also new to StackOverflow so hope you will forgive any errors in communicating here. My simple web application uses Selenium to automatically go to a specific website and enters a search term in the driver.title input box. Now all works but I get an AssertionError. I looked on StackOverflow and other websites but couldn't figure out how to solve this one. My goal was to teach myself how to use Selenium to automate. My app was built using Jupyter Notebook v6.0.1 which uses Python3.7.</p>
  <p>I would be grateful for your help/tips. Many Thanks, Sean</p>
  <p>Here is the error:</p>
  <pre><code>Exception in Tkinter callback
  Traceback (most recent call last):
    File &quot;/Users/seankerr/opt/anaconda3/lib/python3.7/tkinter/__init__.py&quot;, line 1705, in __call__
      return self.func(*args)
    File &quot;&lt;ipython-input-9-c3e0a628cdec&gt;&quot;, line 38, in hackathons
      assert &quot;hackathons&quot; in driver.title
  AssertionError
  </code></pre>
  <p>Here is the python code:</p>
  <pre><code>import selenium
  import tkinter as tk
  from tkinter import *
  from tkinter import messagebox  #SEAN NOTE: you don't need to import message box from
  #tkinter separately because you have already imported '*' all tkinter tools/widgets
  import os
  import subprocess
  import platform
  from selenium import webdriver
  from selenium.webdriver.common.keys import Keys
  
  def ask_quit():
      if messagebox.askokcancel(&quot;Quit&quot;,&quot;Are you sure you want to quit the application and close the window?&quot;):
          root.destroy()
          
  root = tk.Tk()
  root.title(&quot;Hackathon Fetcher&quot;)
  root.geometry('200x200+200+200')
  root.protocol(&quot;WM_DELETE_WINDOW&quot;, ask_quit)
  
  
  def raise_app(root: Tk):
      root.attributes(&quot;-topmost&quot;, True)
      root.title(&quot;Test Title&quot;)
      if platform.system() == 'Darwin':
          tmpl = 'tell application &quot;System Events&quot; to set frontmost of every process whose unix id is {} to true'
          script = tmpl.format(os.getpid())
          output = subprocess.check_call(['/usr/bin/osascript', '-e', script])
      root.after(0, lambda: root.attributes(&quot;-topmost&quot;, False))
      
  def hackathons():
      driver = webdriver.Chrome(&quot;./chromedriver&quot;)
      driver.get(&quot;https://challengerocket.com/hackathons-and-challenges.html&quot;)
      assert &quot;hackathons&quot; in driver.title    
      elem = driver.find_element_by_name(&quot;searchitems&quot;)
      elem.send_keys(&quot;python&quot;)
      elem.send_keys(Keys.RETURN)
      
  Button(root, text= 'Fetch Python Hackathons', command = hackathons).pack(padx = 20)
  #Button(root, text= &quot;Quit&quot;, command = ask_quit).pack(expand=1, fill=tk.Y)   
  root.mainloop()
  </code></pre>