devexpress link

5 posts, 0 answers
  1. Glen
    Glen avatar
    8 posts
    Member since:
    Feb 2013

    Posted 06 Jun 2013 Link to this post

    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

  2. Plamen
    Admin
    Plamen avatar
    8 posts

    Posted 06 Jun 2013 Link to this post

    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!
  3. Glen
    Glen avatar
    8 posts
    Member since:
    Feb 2013

    Posted 07 Jun 2013 Link to this post

    Thanks Plamen. I have raised the support ticket. Id is: 702103
  4. Glen
    Glen avatar
    8 posts
    Member since:
    Feb 2013

    Posted 17 Jun 2013 Link to this post

    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
  5. Plamen
    Admin
    Plamen avatar
    8 posts

    Posted 19 Jun 2013 Link to this post

    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!
Back to Top