or
Hello,
I have written the script below to click the link but the issue is that it is devexpress link. So everytime I run the script it gives error "Object reference not set to instance of object".
HtmlTableRow containerRow=
null;
foreach
(HtmlTableRow r in Pages.EndpointPULSE.FrameContentiframe.Messagegrid.AllRows)
{
foreach(HtmlTableCell c in r.Cells)
{
Log.WriteLine(
"Cell found. TextContent:"+c.InnerText);
if (c.TextContent.Equals("New Message"))
{
containerRow = c.Parent<HtmlTableRow>();
}
}
}
HtmlTableCell editbutton = containerRow.Cells[
1];
editbutton.ScrollToVisible();
editbutton.MouseClick();
Regards,
Glen
[CodedStep(@
"Enter text '' in 'TxtSearchText'"
)]
public
void
WebTest1_CodedStep()
{
int
randomNum = Utility.getNumber();
Actions.SetText(Pages.COBRApointTPAPortalHome.TxtSearchText, randomNum.ToString());
}
public
class
Utility {
public
void
getNumber(){
System.Random random =
new
System.Random();
int
randomNum = random.Next(100000000,999999999);
}
}