webdriver + reset Chrome
<p>I'm trying to 'reset' Chrome browser using webdriver(python). What I'm doing is:</p>

<blockquote>
  <p>driver = webdriver.Chrome()</p>
  
  <p>driver.get('chrome://settings/resetProfileSettings')</p>
</blockquote>

<p>above shows pop-up with 'reset' button, and I can't locate it using </p>

<blockquote>
  <p>driver.find_element_somehow</p>
</blockquote>

<p>please help me find a way to click 'reset' button.</p>

<p>Note: I also was trying to wipe all the files from '~/.config/google-chrome/' but that didn't serve needs.</p>

<pre><code>driver = webdriver.Chrome()
main_window_handle = None
while not main_window_handle:
    main_window_handle = driver.current_window_handle
popup_handle = None
while not popup_handle:
    for handle in driver.window_handles:
        if handle != main_window_handle:
            popup_handle = handle
            break
driver.switch_to.window(popup_handle)
driver.find_element_by_xpath(u'XPATH OF RESET BUTTON').click()
driver.switch_to.window(main_window_handle)
</code></pre>

<p>I think <code>switch_to.window(handle)</code> is deprecated lately, so instead of that, use:</p>

<pre><code>switch_to_window(handle)
</code></pre>

python google-chrome webdriver