cancel
Showing results for 
Search instead for 
Did you mean: 

querying JSON strings

SOLVED
Valued Contributor

querying JSON strings

Hi,

I have some JSON strings I would like to query (have the list of a node, the count...).

Is this possible ?

Thank you,

Mehdi

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Hero

Re: querying JSON strings

Hi Mehdi,

 

JScript/JavaScript contains built-in JSON support.

My guess is that Python should have relevant library as well.

For other script languages you have two options: a) create jScript-based Script Extension to process JSON as required; or b) use some third-party library and use it from your test code.

Because of certain considerations, I went the latter way and tried .Net Newtonsoft.Json.dll. The current overall result is positive though I am still in the process of implementing the functionality that I would like to have in my test code.

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================

View solution in original post

4 REPLIES 4
Highlighted
Community Hero

Re: querying JSON strings

Hi Mehdi,

 

JScript/JavaScript contains built-in JSON support.

My guess is that Python should have relevant library as well.

For other script languages you have two options: a) create jScript-based Script Extension to process JSON as required; or b) use some third-party library and use it from your test code.

Because of certain considerations, I went the latter way and tried .Net Newtonsoft.Json.dll. The current overall result is positive though I am still in the process of implementing the functionality that I would like to have in my test code.

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================

View solution in original post

Highlighted
Valued Contributor

Re: querying JSON strings

Hi Alex,

Thank you very much, I noticed that some of my colleagues also use Newtonsoft.Json.dll

I will add it in the CLR bridge and use it as I use PdfBox.

🙂

Highlighted
Community Hero

Re: querying JSON strings

Hi Mehdi,

 


I noticed that some of my colleagues also use Newtonsoft.Json.dll

If you have someone who can help you with Russian text, then http://software-testing.ru/forum/index.php?/topic/33135-jsonpath-dlia-testcomplete/#entry151695 thread was a helpful starting point for me.

Also https://goessner.net/articles/JsonPath/ and samples from https://www.newtonsoft.com/json/help/html/Introduction.htm

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
Highlighted
Valued Contributor

Re: querying JSON strings

Hi Alex,

Google translate gives me something quite enough understandable.

It's very interesting, thank you.

New Here?
Join us and watch the welcome video:
Read the Latest News
JuneSCNJ
Top Kudoed Authors