
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
How to read data from json file in local
Hi expert,
I have a json file in local ( like: D:\FILE\abc.json). Pls help me when using UFT One
- How I can load json file?
- How I can read data from json file ( like some fields: ID, User, Pass..) then get that data to fill to other fields on web app?
Thanks,
QuyenTA

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
pls help in this case.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Are you using Gui test or API test.
If Gui test you may need to check this https://stackoverflow.com/questions/12153925/decode-encode-json-with-vbscript
for API test, since it's .net based, so it's easy to use Newtonsoft for parsing.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hi Jerrry,
I am using GUI testing.
My case detail. I have a json file (pls see as attached). I need to get data from this file( like some fields: ID, BID,TYPE...) then msgbox them. pls help in this.
I tried other when I search on google.
- I am using library - appJson.qfl ( https://stackoverflow.com/questions/41610139/using-vbscript-to-access-all-values-in-json-data)
- then I try some code on UFT, but I tried to run it. I got nothing
- pls see more as attached.
Thanks,


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
1) JSON parse to vbscript dictionaries
2) Excel file editor (without msoffice)
3) Automatic code format
4) Batch runner with portable results
Thanks,
Sudhakar Kakunuri
www.QtpSudhakar.com
Author - Cracking The QTP Interview Book published by TataMcGrawHill

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hi Sudhakar Kakunuri,
Yes, I hope so...


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hi,
we are using this API https://www.chilkatsoft.com/refdoc/xChilkatJsonObjectRef.html
It's free and working well for reading writing json files (complex and simple ones)
Cheers
mti

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
First of all, from you code, the appJson LoadJSON only accept a JSON string. Below is a workable sample.
Set oJson = NewAspJSON
oJson.loadJSON("{Result:{STATUSCODE:'000000',DATA:{ID:19,BID:'123',TYPE:'432432'}}}")
Set result = oJson.data.Item("Result")
Status = result.item("STATUSCODE")
msgbox Status