Sometime it’s hard to iterate through HtmlCell and click on Html Button or Radio Button or Check-boxes which is within HtmlCell. In my previous post, I have already described How to get InnerText of HtmlCell and now I am providing sample code to click on HtmlButton.

Here we go-

public void ClickonButton ()
{
HtmlTable PackageTable = new HtmlTable(browser);
PackageTable.SearchProperties.Add(“Id”, “TableID”);
PackageTable.DrawHighlight();
HtmlCell Cell = new HtmlCell(PackageTable);
Cell.FilterProperties[HtmlCell.PropertyNames.RowIndex] = RowNumber.ToString();
Cell.FilterProperties[HtmlCell.PropertyNames.ColumnIndex] = CellNumber.ToString();
HtmlInputButton SaveBtn = new HtmlInputButton(Cell);
SaveBtn.SearchProperties.Add(“Id”, “btnPubPkg”);
SaveBtn.DrawHighlight();
Mouse.Click(SaveBtn);
}

Comment it out if it does not work for you.

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s