I'm attempting to use Selenium WebDriver to select a link named cslLogin on a web page. It's located in a child frame called topframe but I can't access it, even after I switch to its parent frame TopLevelFrame which I can do successfully. The html page has this basic layout:
<html>
<head>...</head>
<frameset name="ATopLevelFrameSet">
<frame name="TopLevelFrame">
#document
<html>
<head></head>
<frameset name="Aframeset">
<frame name="topframe">
#document
<html>
<head>...</head>
<body class="clsBgColor">
<table id="tblTitle">
<tbody>
<tr class="clsBackYellow"">
<td class="clsDeviceStatusLink">
<a class="clsLogin" href="javascript:void(0);"
onclick="javascript:fnnLoginClick();">Login</a> == $0
etc...
I can successfully switch to TopLevelFrame using self.driver.switch_to.frame("TopLevelFrame") but I cannot then access topframe or clsLogin (I get NoSuchFrameException and NoSuchElementException, respectively)
I've tried find_element_by_name, find_element_by_xpath, find_element_by_link_text, find_element_by_css_selector, and have also used
try:
element = WebDriverWait(self.driver, 10).until(
EC.presence_of_element_located((By.NAME, "TopLevelFrame"))
)
finally:
self.driver.quit()
in case it was a time/page loading issue, but it times out long after the page loads.
I know from other posts that I need to switch to the nearest frame first before I can access the element, but of course this isn't working. Any suggestions? Thanks in advance.