Тёмный

Must Know JAVA concepts | Selenium Automation | PART - 7 | JSON | Reading JSON in Java 

Learn Automation Online
Подписаться 82 тыс.
Просмотров 12 тыс.
50% 1

What is a JSON File?
-----------------------------------
JSON stands for JavaScript Object Notation. JSON file contains,JSON Objects with .json file extension.
In this modern era, we have a lot of programming languages. Almost all of us use different web services in our daily life (Eg. Weather report, currency conversion, enquiring Gold rates, cricket scores).
Our browser is the point of contact, to make the request to the server, receive the response from the server, process the response and render it to the user. A web server may be implemented with any programing language like Java, python etc. Our browser can understand Javascript. So there has to be a common, language-independent data transmission between a web application and a web server.
What we will learn in this video:
1. Steps to read the JSON file
2. Typecasting in Java
Json-simple Jar download link: bit.ly/2RDNlXb
#Java #Selenium #JSONReading #LearnAutomationOnline
Best way to reach me (replies will be faster): RU-vid comment section
Also, you can follow me on Facebook and Instagram.
Facebook: bit.ly/2TqPlis
Instagram: bit.ly/2Ez36rH

Опубликовано:

 

18 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 41   
@abarnajayachandran1298
@abarnajayachandran1298 2 года назад
Thanks for this Excellent video, Coding fear is getting decreasing why because post explanation of logic and steps you are teaching to write a code..!! really awesome..!!Cheers !!
@tourpolamvanga2417
@tourpolamvanga2417 4 года назад
Bro ithana naala enga irunthinga awesome explanation bro...
@priyarakesh1171
@priyarakesh1171 4 года назад
Hi Arul, successfully completed Selenium, Java for selenium and must know java concepts, i didnt expect that i can learn selenium this much easy way, i was wasting tym in different sites almost 3months, institutions... i couldnt understand the way they explained as m very begginer to selenium and java, as well poor communication, finaly via my friend i got this site and really i completed with in 3weeks with different example i workedout, thanks alot for the timely help bro, i am in a need of getting job soon,now i have a confident, once i get job i will contact u via facebook or insta bro, thank alot. many people not aware of such a wonderful site and struggling, i wish your site should reach to all needy people, especially tamil medium students will get benefit most.
@LearnAutomationOnline
@LearnAutomationOnline 4 года назад
That's so nice to hear. Wishing u good luck to get your job as soon as possible. The only way my videos can reach the needy is by people like u. Kindly share it with your circle and ask them to share with their circle. 😊. Waiting to hear your success story.
@priyarakesh1171
@priyarakesh1171 4 года назад
@@LearnAutomationOnline yea sure arul, Thank u for ur wish.
@nantha7128
@nantha7128 Год назад
job kidaichatha sister
@paulthilak
@paulthilak 4 года назад
Boss, your explanations are so simple and easy to understand by every Thamizhan even a non-techie one with who know basic concept java to understand. Your example of TypeCasting.. oil plastic bag in to another bag.. Varraeh.. Vaa.. :) keep it up bro
@LearnAutomationOnline
@LearnAutomationOnline 4 года назад
😊
@Ravisankar-si8bg
@Ravisankar-si8bg 4 года назад
Nice example bro.....
@prabakarm5025
@prabakarm5025 4 года назад
Top bro
@benittoraja5957
@benittoraja5957 2 года назад
Thank you.
@raghuramanraman9780
@raghuramanraman9780 11 месяцев назад
Brother JSon array LA first element Mattum display pannanum...Atha epdi code LA eluthurathu
@rvthym89
@rvthym89 Год назад
I have a doubt while printing iterator.next(), will it print the value in first index, or it will start printing from 2nd as its next(),
@meenavinothviyanmivan
@meenavinothviyanmivan Год назад
To those who are getting error use String instead of long. We are getting correct output package extentproject; import java.io.FileReader; import java.io.IOException; import java.util.Iterator; import org.json.simple.JSONArray; import org.json.simple.JSONObject; import org.json.simple.parser.JSONParser; import org.json.simple.parser.ParseException; public class Classfilewriter { public static void main(String[] args) throws IOException, ParseException { JSONParser jsonparser = new JSONParser(); FileReader filereader = new FileReader("file.txt"); //we cannot directly read from jsonparser so we are converting to jsonobject Object parsedobject = jsonparser.parse(filereader); JSONObject jsonobject = (JSONObject) parsedobject; String name = (String) jsonobject.get("name"); String age = (String) jsonobject.get("age"); JSONArray array = (JSONArray) jsonobject.get("qualities"); Iterator iterator = array.iterator(); System.out.println(name); System.out.println(age); while((iterator.hasNext())) { System.out.println(iterator.next()); } } } Output: testing 5 magical memories testing memories
@mushekfahath9245
@mushekfahath9245 2 года назад
Instead of All those type casting, why can't we store the data into Object return type.. brother ?!?
@LearnAutomationOnline
@LearnAutomationOnline 2 года назад
Yeah we can do that as well. I don't what I was thinking at that time. If u see the latest rest assured tutorials, I would have stored in objects.
@ParthiPlays
@ParthiPlays 2 года назад
class java.lang.String cannot be cast to class java.lang.Long (java.lang.String and java.lang.Long are in module java.base of loader 'bootstrap') at jsonReadingOperation.JsonReadingExample.main(JsonReadingExample.java:26) intha error varuthu na
@ParthiPlays
@ParthiPlays 2 года назад
Age ku Long Pathila String Class use panna correcct ah output varuthu
@kadhaikalamvaanga9824
@kadhaikalamvaanga9824 2 года назад
@@ParthiPlays Cannot invoke "org.json.simple.JSONArray.iterator()" because "array" is null at JsonReadWrite.JsonReadingExample.main(JsonReadingExample.java:20) intha error adikuthu bro String use pana aprm
@vkvivek
@vkvivek 4 года назад
If possible, please put videos on parallel execution Thanks
@LearnAutomationOnline
@LearnAutomationOnline 4 года назад
Please refer TestNG playlist and grid video. Parallel execution has been explained in that.
@jayaprakash9172
@jayaprakash9172 4 года назад
Bro, IAM getting this error while running "Exception in thread main unexpected character (p) at position 1
@LearnAutomationOnline
@LearnAutomationOnline 4 года назад
Make sure your json file is valid. Use websites like jsonlint to ensure your json is valid
@priyarakesh1171
@priyarakesh1171 4 года назад
Arul, as a begginer( 3years L2 support experience), 3 years gap due to marriage and kid, after a break i need to try for Testing role as i can get plenty of option. in which part and all i need to concentrate? or i need to learn all your videos?
@LearnAutomationOnline
@LearnAutomationOnline 4 года назад
Considering the current competition in the job market, it's wiser to master most of the things with respect to test automation. I would suggest you to be thorough, I mean THOROUGH with selenium, TestNG, github, rest API, libraries like unirest or rest assured, cucumber, page object model, java collection concepts and Jenkins. Remaining all will be nice to have. Feel free to ping or comment in case you need further clarifications.
@priyarakesh1171
@priyarakesh1171 4 года назад
​@@LearnAutomationOnline ok arul thanks alot for your guidance, i will learn those as well and get back to u once done.
@karthikeyansugumar20
@karthikeyansugumar20 5 лет назад
@7.55 - What is the difference between primitive data type & class?
@LearnAutomationOnline
@LearnAutomationOnline 5 лет назад
Primitive data types and classes are not comparable one. A wrapper class is just like any other java class, provided to give the support for all the primitive data types java was supporting inorder to make it more object oriented.
@karthikeyansugumar20
@karthikeyansugumar20 5 лет назад
@@LearnAutomationOnline I guess after goin to marriage u became more enthusiastic. I'm a lay man in Java. So simple ah explain pannunga with ur classic examples - oil, wire bag, vessel😂😂
@sundharyuvi8221
@sundharyuvi8221 4 года назад
Hi, How to get response results (ex: 1 or -1) . I have invisible error message.
@LearnAutomationOnline
@LearnAutomationOnline 4 года назад
Invisible error message!🙄 Can you please elaborate. I don't get u
@sundharyuvi8221
@sundharyuvi8221 4 года назад
@@LearnAutomationOnline sry... It's visible but immediately it's disappeared. In "Elements" No records for this pop-up. I get only results 1 or -1 . Can you understand
@sundharyuvi8221
@sundharyuvi8221 4 года назад
Any chances?
@pratheepkumar4218
@pratheepkumar4218 4 года назад
Bro, I want to register a company with different roles. Role is like electronic, mechanical, I have 12 roles. At one time or immediately I want to register. How to test different roles using JSON with selenium. Can you please. Or data driven . Please make a video for this. My case I real time scenario. How to execute 12 times with different roles.
@LearnAutomationOnline
@LearnAutomationOnline 4 года назад
For this case you should not use, selenium. You should be focusing on the registration API, with the JSON body. You have to discuss with the developer of the application to get the API for that.
@pratheepkumar4218
@pratheepkumar4218 4 года назад
@@LearnAutomationOnline I have the API. How to run 12 times with multiple companies registration. Can you make a sample for this.
@sathyaraj9875
@sathyaraj9875 2 года назад
plastic ban pathram vachiko
@kadhaikalamvaanga9824
@kadhaikalamvaanga9824 2 года назад
Bro iterator ku error show aguthu bro Cannot invoke "org.json.simple.JSONArray.iterator()" because "array" is null at JsonReadWrite.JsonReadingExample.main(JsonReadingExample.java:20)
@michaelr323
@michaelr323 Год назад
sir, I have a doubt, can we use List to store multiple values of "special quality" instead of JSONArray, why do we go for JSON Array, Is there any specific reasons?
@LearnAutomationOnline
@LearnAutomationOnline Год назад
List can store any type of data.
@michaelr323
@michaelr323 Год назад
@@LearnAutomationOnline okay sir, Thank you so much
Далее
연준 (YEONJUN) ‘GGUM’ Official MV
02:44
Просмотров 3,2 млн
С чего всё началось?
00:42
Просмотров 116 тыс.
КОСПЛЕЙ НА СЭНДИ ИЗ СПАНЧБОБА
00:57
Learn JSON in 10 Minutes
12:00
Просмотров 3,2 млн
How to Read Data from JSON file using JAVA Code
10:00
연준 (YEONJUN) ‘GGUM’ Official MV
02:44
Просмотров 3,2 млн