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

Fetch data using Jquery in telerik testing framework

8 Answers 81 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Vinay
Top achievements
Rank 1
Vinay asked on 16 May 2018, 12:26 PM

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

 

8 Answers, 1 is accepted

Sort by
0
Vinay
Top achievements
Rank 1
answered on 16 May 2018, 01:21 PM

Hi telerik,

Someone please look into this.Its urgent.

0
Vinay
Top achievements
Rank 1
answered on 17 May 2018, 09:54 AM
Its urgent. Could you please help me with this?
0
Vinay
Top achievements
Rank 1
answered on 17 May 2018, 04:36 PM
Is there anyone to help?
0
Elena
Telerik team
answered on 18 May 2018, 03:21 PM
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
 
0
Vinay
Top achievements
Rank 1
answered on 21 May 2018, 03:22 PM

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.

0
Vinay
Top achievements
Rank 1
answered on 21 May 2018, 03:25 PM

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

0
Vinay
Top achievements
Rank 1
answered on 21 May 2018, 03:58 PM

Sorry, i was missing the # sign

0
Elena
Telerik team
answered on 22 May 2018, 11:23 AM
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
 
Tags
General Discussions
Asked by
Vinay
Top achievements
Rank 1
Answers by
Vinay
Top achievements
Rank 1
Elena
Telerik team
Share this question
or