[py] Correct frame switching expected condition
During PRs a conflict didn't get landed properly. This should fix it.
@@ -22,6 +22,7 @@ from selenium.common.exceptions import NoSuchFrameException
from selenium.common.exceptions import StaleElementReferenceException
from selenium.common.exceptions import WebDriverException
from selenium.common.exceptions import NoAlertPresentException
+from selenium.webdriver.common.by import By
from selenium.webdriver.remote.webdriver import WebElement
"""
@@ -219,11 +220,10 @@ def frame_to_be_available_and_switch_to_it(locator):
"""
def _predicate(driver):
try:
- if hasattr(self.frame_locator, '__iter__'):
- driver.switch_to.frame(_find_element(driver,
- self.frame_locator))
+ if hasattr(locator, '__iter__'):
+ driver.switch_to.frame(driver.find_element(locator))
else:
- driver.switch_to.frame(locator)
+ driver.switch_to.frame(driver.find_element(By.NAME, locator))
return True
except NoSuchFrameException:
return False
