You can use Explicit Wait:
An explicit wait is a code you define to wait for a certain condition to occur before proceeding further in the code.
OPTION-1:
driver.implicitly_wait(10) # seconds
select_country = Select(self.browser.css("#country_id"))
select_country.select_by_visible_text("Russia")
city = driver.find_element_by_css_selector("#city_id")
wait = WebDriverWait(driver, 10)
city_dropDown = wait.until(expected_conditions.visibility_of_element_located(city))
select_city = Select(city_dropDown)
select_city.select_by_visible_text("Moscow")
OPTION-2:
from selenium.webdriver.support import expected_conditions as EC
select_country = Select(self.browser.css("#country_id"))
select_country.select_by_visible_text("Russia")
wait = WebDriverWait(driver, 10)
element=wait.until(EC.element_to_be_selected(driver.find_element_by_css_selector("#city_id")))
select_city = Select(element)
select_city.select_by_visible_text("Moscow")
OPTION-3:
select_country = Select(self.browser.css("#country_id"))
select_country.select_by_visible_text("Russia")
try:
element = WebDriverWait(driver, 10).until(
EC.presence_of_element_located((By.ID, "city"))
//---------use other element locators too like xpath/css_selector/css_name
)
finally:
select_city = Select(element)
select_city.select_by_visible_text("Moscow")
OPTION-4:
You can also try with Implicit Waits:
An implicit wait tells WebDriver to poll the DOM for a certain amount of time when trying to find any element (or elements) not immediately available.
driver.implicitly_wait(10) # seconds
select_country = Select(self.browser.css("#country_id"))
select_country.select_by_visible_text("Russia")
driver.implicitly_wait(10) # seconds
select_city = Select(self.browser.css("#city_id"))
select_city.select_by_visible_text("Moscow")