This is a migrated thread and some comments may be shown as answers.

devexpress link

4 Answers 45 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Glen
Top achievements
Rank 1
Glen asked on 06 Jun 2013, 05:31 AM

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

4 Answers, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 06 Jun 2013, 06:32 AM
Hi Glen,

Thanks for providing the code. Looking the code however it's not clear to me which line is causing a NullReference exception. Can you please provide some screenshots showing how these elements are structured in the DOM tree of your application? It would be even better if you can provide direct access to your application, so I can test this directly against your app and provide you with a workable solution. Alternatively you can capture a Fiddler trace and attach it in a ZIP file. If you are unfamiliar with how to do so, this link will provide you with step-by-step instructions for download and use. This trace will allow us to "simulate" your application locally in order to reproduce the problem. If you feel any of this information is sensitive, you can submit a support ticket which is confidential, unlike this forum.

Regards,
Plamen
Telerik
Free summer webinars on advanced web automation tactics hosted by Jim Holmes & Adam Goucher.
Reserve your seat today!
0
Glen
Top achievements
Rank 1
answered on 07 Jun 2013, 11:18 AM
Thanks Plamen. I have raised the support ticket. Id is: 702103
0
Glen
Top achievements
Rank 1
answered on 17 Jun 2013, 07:33 AM
Hello Plamen,

This is in continuation with clicking hyperlink mentioned in this fourm discussion. What can I do if the table has paging?
I mean if the devexpress link is on the second page of the table? How can we click that?

Glen
0
Plamen
Telerik team
answered on 19 Jun 2013, 07:50 AM
Hi Glen,

You need to add an additional code to go through all pages searching for the element you want to click on. See this code sample article for a demonstration of a similar scenario. 

If you are having difficulty to implement that, we'll need a sample public app to work against in order to assist you in writing the code.    

Regards,
Plamen
Telerik
Free summer webinars on advanced web automation tactics hosted by Jim Holmes & Adam Goucher.
Reserve your seat today!
Tags
General Discussions
Asked by
Glen
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Glen
Top achievements
Rank 1
Share this question
or