Q:

How Can I wait for an Element will be visible then be clicked in Python Selenium Webdriver? 

In odoo I have written code to click on the send button that is 
browser.find_element_by_xpath("//span[.='Send']").click()

After this send button is clicked , then I have to clicked on "Confirm Sale" button , but at run time it is giving an error like Element is not visible
I have also tried
webdriver.wait.until(browser.find_element_by_xpath("//span[.='Confirm Sale']"))

but it arises an error like 
AttributeError: 'module' object has no attribute 'wait'

I am sticking 2 images for that

But here after send button clicked , the workflow state is also changed from "Draft Quotation" to "Quotation Sent" so , how can I wait my webdriver for all these things done & then click on "Confirm Sale" button
I have declared my webdriver like this 
def setUp(self):
    self.browser = webdriver. Firefox()
    browser = self.browser
    browser.get("http://localhost:5555")

so please provide me exact code for that

A:

You have to import the webdriver wait module.  you can do something like the example below.  
Read more abut waits at Waits
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait

wd = webdriver. Chrome(executable_path="your/path/to/chromedriver")

# Access website

wait = WebDriverWait(wd, 10)
confirm = wait.until(EC.element_to_be_clickable((By. XPATH, "//span[.='Confirm Sale']")))
confirm.click()

