Fetch data using Jquery in telerik testing framework

9 posts, 0 answers
  1. Vinay
    Vinay avatar
    47 posts
    Member since:
    Jan 2015

    Posted 16 May Link to this post

    Hi telerik,
    I am working on a scenario where i have to access the value using jquery. This below div [class="client-errors"] contains data which i exposed using jquery.

       < div id="automation-testing">
           <div class="client-errors"></div>
        < div class="menus"></div></div>

    At my application end i am able to fetch the requested data using -

        "$("automation-testing div.client-errors").data().

    But when i am trying to access it using telerik  testing framework, i am not getting that data.
           HtmlControl ctrl = Manager.ActiveBrowser.Find.ByExpression<HtmlControl>("id=automation-testing", "|", "class=client-errors");
           Console.Writeline(ctrl.AsjQueryControl().val);

    I am not getting any data using the above approach.

    Please look into this nd let me know the way to capture the data using jquery.

    Thanks & Regards

     

  2. Vinay
    Vinay avatar
    47 posts
    Member since:
    Jan 2015

    Posted 16 May Link to this post

    Hi telerik,

    Someone please look into this.Its urgent.

  3. Vinay
    Vinay avatar
    47 posts
    Member since:
    Jan 2015

    Posted 17 May Link to this post

    Its urgent. Could you please help me with this?
  4. Vinay
    Vinay avatar
    47 posts
    Member since:
    Jan 2015

    Posted 17 May Link to this post

    Is there anyone to help?
  5. Elena Tsvetkova
    Admin
    Elena Tsvetkova avatar
    939 posts

    Posted 18 May Link to this post

    Hello Ranjeet,

    Thank you for the shared details. 

    As of what you had listed I would recommend you directly invoke the JavaScript in code. 

    Actions.InvokeScript("$('automation-testing div.client-errors').data()." );

    I hope this will be helpful to you! 

    Regards,
    Elena Tsvetkova
    Progress Telerik
     
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
     
  6. Vinay
    Vinay avatar
    47 posts
    Member since:
    Jan 2015

    Posted 21 May in reply to Elena Tsvetkova Link to this post

    Hi Elena,

    Thanks for looking into this.

    I have tried the above approach. But this function is returning null.

    Actions.InvokeScript("$('automation-testing div.client-errors').data()")

     

    I am doing it wrong. Pleas elook into this.

  7. Vinay
    Vinay avatar
    47 posts
    Member since:
    Jan 2015

    Posted 21 May in reply to Vinay Link to this post

    Am i doing it wrong? Is there anything i am missing?

  8. Vinay
    Vinay avatar
    47 posts
    Member since:
    Jan 2015

    Posted 21 May in reply to Vinay Link to this post

    Sorry, i was missing the # sign

  9. Elena Tsvetkova
    Admin
    Elena Tsvetkova avatar
    939 posts

    Posted 22 May Link to this post

    Hi Ranjeet

    Thank you for getting back to me. 

    Please note that I have used the information shared by you how to invoke the script. Based on your last note I guess you found what you have missed on your own. If you need further assistance please share details what you cannot accomplish. 

    Regards,
    Elena Tsvetkova
    Progress Telerik
     
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
     
Back to Top