I am trying to automate a web UI that seems to be using frames. I am unable to locate some of the elements in that UI unlike other UI’s that are developed without frame concept.
For eg: I am trying to click on a dropdown field. When I inspectd the field using “Firebug”, I am see this html stack for this dropdown.
<frame border="0" marginheight="0" marginwidth="5" name="body" noresize=""
src="Pub_Docs/index.htm">
<body marginwidth="5" marginheight="0">
<form action="../dxnrequest.aspx?RequestName=TadiPost" method="POST">
<input type="hidden" name="TadiServer" value="TPASS"/>
<input type="hidden" name="TadiUrl" value="/testdx/curr_hols.call"/>
<div style="position: relative; left: 5px; top: 0px;">
<table width="100%" class="BKGND">
<tbody>
<tr>
<tr>
<td>
<div style="position: relative; left: 4px; top: 1px;">
<table width="100%" class="PARAMS">
<tbody>
<tr>
<td valign="TOP">
<table class="CLEAR">
<tbody>
<tr>
<td class="HEADER">Currency:</td>
<td>
<**select name="in_CUR_CODE" size="1">**
</td>
</tr>
<tr>
<tr>
<tr>
</tbody>
</table>
</td>
<td valign="TOP">
</tr>
<tr>
<tr>
</tbody>
Firebug is pointing to name=”in_CUR_CODE for this dropdown.So I thought this would work.
ccy_dd_locator = "//form[@method='POST']//select[@name='in_CUR_CODE']"
CCY_DD_LOCATOR_VALUE_XPATH = (By.XPATH, 'ccy_dd_locator_value')
frame = WebDriverWait(self.driver,
5).until(EC.frame_to_be_available_and_switch_to_it((By.NAME, 'body')))
WebDriverWait(self.driver,
15).until(EC.presence_of_element_located(CCY_DD_LOCATOR_VALUE_XPATH)).click()
But its not locating the dropdown and I am getting “Timeout” exception.
Is there a different way in selenium to locate elements from an UI that are using frames?
This doesn’t seem to work as with other UI’s that are not using frames.
Any help in understanding this is much appreciated.