how i can click on <td in <table> with WatiN

天大地大妈咪最大 提交于 2019-12-11 21:22:11

问题


I want the mouse move on line that contained onclick method

and Click on it

How i can do this ???

<table width="100%" class="FormTable" border="0" cellspacing="1" cellpadding="0">
<tbody>
<tr>
<td>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="100" background="/images/tabimage/nrm_bg.gif" nowrap="" onmouseover="this.style.cursor = 'pointer';" onmouseout="this.style.cursor = 'default';" onclick="__doPostBack('HstUnitExchangeLetterSendEdit$tabControl1','1')">

<div class="Normal">
---text---main info

回答1:


What is this yaar have checked my previously given code and its working fine on the html page given by you

Browser browser = SetupBrowser();
browser.GoTo("file:///C:/Users/vbhadauria/Desktop/New%20folder/mail.html");
var tablecell = browser.TableCell(Find.By("background", "/images/tabimage/sel_bg.gif"));
tablecell.Click();
browser.WaitForComplete();

You can also check check it on local machine only.




回答2:


You can find the Table cell like this

var tableCell = browser.TableCell(Find.By("background", "/images/tabimage/nrm_bg.gif"));

//Then click on it
tableCell.Click();
//Wait for browser to load properly
browser.WaitForcomplete();


来源:https://stackoverflow.com/questions/17925667/how-i-can-click-on-td-in-table-with-watin

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!