When we are asked to identify the broken links in the application, what we do? Collecting all the links on the page to a list and looping through links, clicking on links one by one and verify whether the content on the next page displayed or not?
This process is time consuming, and not that effective as it involves multiple to and fro actions. We can identify the broken links without clicking on the each link using Rest-assured (Java API Library). If you wish to know more about rest-assured click this link. Lets jump into coding part.
Search for "rest-assured maven dependency" in Google. Then copy the latest version of rest-assured dependency of "io.rest-assured" as shown in the below screenshot. Add it to your pom.xml file.
In Rest-assured, we have a Http method called "GET", this method is used for retrieving the information from the server. If the link is not broken the server sends response with status code 200 (OK), if the link is broken we receive it sends the status code 404 (Not Found). We use the same logic in our test case.
As shown in the above program, we get the status code of each link and we verify whether it is equal to 200 or not. If not 200, we the link is considered as broken link.
Check the result in the screenshot below
This is how we can identify the broken links using Rest-assured easily.
#HappyTesting #HappyLeaarning #qababu
This process is time consuming, and not that effective as it involves multiple to and fro actions. We can identify the broken links without clicking on the each link using Rest-assured (Java API Library). If you wish to know more about rest-assured click this link. Lets jump into coding part.
Search for "rest-assured maven dependency" in Google. Then copy the latest version of rest-assured dependency of "io.rest-assured" as shown in the below screenshot. Add it to your pom.xml file.
In Rest-assured, we have a Http method called "GET", this method is used for retrieving the information from the server. If the link is not broken the server sends response with status code 200 (OK), if the link is broken we receive it sends the status code 404 (Not Found). We use the same logic in our test case.
As shown in the above program, we get the status code of each link and we verify whether it is equal to 200 or not. If not 200, we the link is considered as broken link.
Check the result in the screenshot below
This is how we can identify the broken links using Rest-assured easily.
#HappyTesting #HappyLeaarning #qababu
ReplyDeleteExcellent Post!! I gathered lots of information here. Do share more updates.
selenium training in velachery
selenium training in tambaram
java training in tambaram
SEO Training in Anna Nagar
Software Testing Training in T Nagar
Python training in chennai
Android Training in OMR
Software testing training in Anna Nagar
RPA Training in T nagar
Web Designing Course in T Nagar
I am glad that I saw this post. It is informative blog for us and we need this type of blog thanks for share this blog, Keep posting such instructional blogs and I am looking forward for your future posts. Python Projects for Students Data analytics is the study of dissecting crude data so as to make decisions about that data. Data analytics advances and procedures are generally utilized in business ventures to empower associations to settle on progressively Python Training in Chennai educated business choices. In the present worldwide commercial center, it isn't sufficient to assemble data and do the math; you should realize how to apply that data to genuine situations such that will affect conduct. In the program you will initially gain proficiency with the specialized skills, including R and Python dialects most usually utilized in data analytics programming and usage; Python Training in Chennai at that point center around the commonsense application, in view of genuine business issues in a scope of industry segments, for example, wellbeing, promoting and account. Project Center in Chennai
DeleteGreat Post with valuable information.I am glad that I have visited this site.Share more updates.
ReplyDeleteselenium training in OMR
selenium training in anna nagar
Java Training in OMR
Java course in Tambaram
DevOps Training in Anna Nagar
Digital Marketing Course in Anna Nagar
Software Testing Training in T Nagar
Graphic design courses in Porur
Web Designing Course in T Nagar
PHP Training in Chennai
It would not be fair if we compliment all the blog writings but not the author.
ReplyDeleteAutomation testing
Nice post. Useful information. This is always happy to know about Salesforce training in Gurgaon whose certification program helps many to get certificed. I strongly urge you to join now in Salesforce Training in Hyderabad | Course Price | Training institute and enroll for free demo at Salesforce Training in Bangalore | Course Certification Cost and Job Placement Assistance . I have gone through this Salesforce Certification Training. Why done you enroll for a free demo at Salesforce training institutes in Chennai [updated] | Course Price
ReplyDeleteGlad to chat your blog, I seem to be forward to more reliable articles and I think we all wish to thank so many good articles, blog to share with us. hire automation professional
ReplyDeleteReally nice post. Thank you for sharing amazing information.
ReplyDeletePega Training in Chennai
Pega Certification Training
Spark Training in Chennai
Oracle Training in Chennai
Linux Training in Chennai
Oracle DBA Training in Chennai
Excellent blog! Thanks for sharing a very interesting blog, I appreciate your blog post.
ReplyDeleteeasy way to learn java
mobile app development platforms
best campaigns
what is cloud computing azure
tableau interview questions pdf
Well Done...! it is very comprehensive and keep updaing here...
ReplyDeleteReactJS Training in Chennai
ReactJS Course in Chennai
PlC Training in Chennai
This is really great and I obtain a huge of knowledge in this post. I loved it..!
ReplyDeletePlacement Training in Chennai
Corporate Training in Chennai
HR Course in Chennai
Best Training and Placement Institute in Chennai
This is one of the best content for this topic and this is very useful for me. Thank you!
ReplyDeleteUnix Training in Chennai
Linux Training in Chennai
Linux Course in Chennai
I read this article. I think You put a lot of effort to create this article. I appreciate your work. this page
ReplyDelete