On a button click a popup window appears in internet explorer, which renders a html (given below), I realized this HTML is in update panel, that's I am not able to find any control/elements on it. I am sure with my code, it is switching to child window (popup window), but it is not able to find elements of popup window .
How can I know how to control switch to child window ?
foreach (String windowHandle in handles)
{
if (!windowHandle.Equals(parentWindow))
{
objDriver.SwitchTo().Window(windowHandle);
//trying to find element is always null on popup window
IWebElement table = objDriver.FindElement(By.TagName("table"));//this is null
//closing child window, this works fine
objDriver.Close();
}
}
Update panel is created like this
<div class="ctl00_updatePanel">
<div class="test">
<div>
<table id="tbl">
<tr>
<td>
<a href="#">text 1</a>
</td>
<td>
<tr>
<tr>
<td>
<a href="#">text 2</a>
</td>
<td>
<tr>
</table>
</div>
</div>
</div>
When I try to find any control in this window it always says element not found and it breaks.
I have already added the to wait
for an element to load
but it still breaks saying element not found, though element is loaded properly in child window.