c# - Switching tabs in IE while doing automation -
i trying automate web page. on there link , clicking it opens in tab. stuck here. have tried redirect
option didn't work.
this web page code on trying automate:
<td class=""> <a href="../tmi/viewcustomerdetails.jsp?mcid=30000248243" target="_new">30000248243</a> </td>
and doing:
public void theniclickatthemcid() { var mcid = webbrowser.current.link(find.bytext("30000248243")); if (!mcid.exists) { assert.fail("unable find mcid name"); mcid.click(); } }
it open link not able move next tab. how can proceed further?
this webbrowser
class:
using techtalk.specflow ; using watin.core; namespace webtest { class webbrowser { public static ie current { { if (!scenariocontext.current.containskey("browser")) scenariocontext.current["browser"] = new ie(); return scenariocontext.current["browser"] ie; } } } }
basically can try:
webbrowser.current.presstab(); webbrowser.current.waitforcomplete();
Comments
Post a Comment