I have c# webdriver configured for my Visual Studio 2010. I want to clcik on a button "Install" from the Iframe. I am writing c# code to click on Install button from this IFrame.
Here is the HTML code...
<html>
<head></head>
<body>
<"pt1:pt2:mvtiframe" class="gradbg af_inlineFrame p_AFFlow" frameborder="0" onload="AdfDhtmlInlineFramePeer.__iframeLoadHandler(event)" src="some url" style="width:700px; height:360px" _adfloaded="1">
<html>
<tr>
<td style="text-align: left; height: 35px" colspan="3">
<table cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td>
<p>
<a class="imageButton" onclick="OnNextButtonClick()" target="_blank" href="http://google.com/abc.asp">
<span>Install</span>
</a>
</p>
</td>
</tr>
</html>
</iframe>
</body>
</html>
I am trying with below code to click on "Install" button. But does not work. It says could not locate the element.
FirefoxDriver driver = new FirefoxDriver();
driver.SwitchTo().Frame(0);
driver.FindElement(By.Name("Install")).Click();
Tried with Xpath but i don't get the Xpath for Install button which is part of the IFrame.