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
Great 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
Glad 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 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