No video

How to find broken links & Images using Selenium Webdriver

  Рет қаралды 98,403

Naveen AutomationLabs

Naveen AutomationLabs

Күн бұрын

How to check the Broken Links and images using Selenium:
**For checking the broken links, you will need to do the following steps.
1. Collect all the links in the web page based on "a" and "img" tags.
2. Send HTTP request for the link and read HTTP response code.
3. Find out whether the link is valid or broken based on HTTP response code.
4. Repeat this for all the links captured.
=======================================
Code Base GIT URL:
github.com/nav...
=======================================
***Subscribe to this channel, and press bell icon to get some interesting videos on Selenium and Automation:
www.youtube.co...
Follow me on my Facebook Page:
/ naveenqtpexpert
~-~~-~~~-~~-~
Follow my Site/Blog: www.naveenautom...
========================================================
Please watch: "Selenium & Automation Interview Preparation - By Naveen AutomationLabs"
• Selenium & Automation ...
~-~~-~~~-~~-~ Subscribe to this channel, and press bell icon to get some interesting videos on Selenium and Automation:
www.youtube.co...
Follow me on my Facebook Page:
/ naveenqtpexpert
Let's join our Automation community for some amazing knowledge sharing and group discussion on Telegram:
t.me/joinchat/...
Paid courses (Recorded) videos:
Java & Selenium Course: www.naveenautom...
API Course: www.naveenautom... ➡️Get Our Courses✔️
📗 Get My Paid Courses at
Paid courses (Recorded) videos:
Java & Selenium Course: www.naveenautom...
API Course: www.naveenautom...
-------------------------------
✔️SOCIAL NETWORKS
Facebook: / naveenqtpexpert
Twitter: / naveenkhunteta
Blog: www.naveenautom...
--------------------------------
Support My Channel✔️Or Buy Me A Coffee
Paypal: paypal.me/nave...
Google Pay: naveenanimation20@gmail.com
--------------------------------
✔️Thanks for watching!
देखने के लिए धन्यवाद
Благодаря за гледането
感谢您观看
Merci d'avoir regardé
Grazie per la visione
Gracias por ver
شكرا للمشاهدة

Пікірлер: 104
@bindunagaraj123
@bindunagaraj123 3 жыл бұрын
Very nicely explained, But I think here u showed only broken links, not broken images, as we just checked href is not null and didn't check for src. Got addicted to ur channel Naveen, learning many things from u. Thank you for sharing ur knowledge.
@mohmashooqdowlati7933
@mohmashooqdowlati7933 Жыл бұрын
Thanks Naveen. This was an outstanding concept clearance video for broken links!!!👏👏👏
@naveenautomationlabs
@naveenautomationlabs Жыл бұрын
Glad you liked it
@stasbob2440
@stasbob2440 3 жыл бұрын
Thanks so much ! This made my day . I'm new to Java , now writing my final project after finishing a course . Working with TestNg though ..Gotta make up an assertion on the test page on this , no clue meanwhile how .. Tremendous stuff !
@omkarpotdar2763
@omkarpotdar2763 2 жыл бұрын
Thanks a lot Naveen for explaining this tricky but important topic in a very easy way. I really appreciated your efforts. Thanks Naveen.
@sourovrahman1700
@sourovrahman1700 3 жыл бұрын
thats a awesome work Mr Naveen
@prithadutta4699
@prithadutta4699 6 жыл бұрын
The content is very compact. Thanks Naveen.
@naveenautomationlabs
@naveenautomationlabs 6 жыл бұрын
+Pritha Dutta thanks pritha
@tejastoley6714
@tejastoley6714 5 жыл бұрын
amazon have 653 links out of which 493 links are active.
@seshareddy7254
@seshareddy7254 6 жыл бұрын
Very nice , very useful information, thanks a lot Naveen
@harshakalluri03
@harshakalluri03 3 жыл бұрын
Thank you so much Naveen ji, you show me a good path to learn selenium
@ABAutomationHub
@ABAutomationHub 4 жыл бұрын
Very good and to the point explanation!! Thanks . Keep up the good work!
@naveenautomationlabs
@naveenautomationlabs 4 жыл бұрын
Thanks Anshita!!
@Vikram.G
@Vikram.G 2 жыл бұрын
Thanx Naveen for explained in details.
@jdhung
@jdhung 4 жыл бұрын
excellent tutorial. Thanks
@priyadharsini4569
@priyadharsini4569 4 жыл бұрын
Amazing explanation. thanks for the video
@seshareddy7254
@seshareddy7254 6 жыл бұрын
Nice Explanation, Thanks Naveen
@ITsMeSimna
@ITsMeSimna 6 жыл бұрын
Ur videos are very impressive!! Thanks a lot
@akonsantosh
@akonsantosh 3 жыл бұрын
Good explanation ❤️❤️❤️🔥🔥🔥🔥, But it would be very complex, if we have multiple pages to test
@testinginsights-muktasharma
@testinginsights-muktasharma 6 жыл бұрын
Can you please look into the GIT once? The code base for this particular concept "Broken links" is not available in your git. I tried to search but I could not find it. Please update it.Thank you!
@SoloTraveller_Shamy
@SoloTraveller_Shamy 4 жыл бұрын
RIGHT ....
@manaligupta1098
@manaligupta1098 6 жыл бұрын
Very easily explained
@ajindia1085
@ajindia1085 5 жыл бұрын
Hey Naveen your explanation is awesome.please tell me answer what will be answer of question currently which method are you using?
@jahangiralikhan2410
@jahangiralikhan2410 5 жыл бұрын
Absolutely you are amazing & very easy to understand, thanks a lot Naveen :)
@arunamaurya8596
@arunamaurya8596 3 жыл бұрын
@Shivanshu Sharma ArrayList is a class which implements List interface.This Arraylist is used to store list of elements of some type .So here we are finding list of webelement Array List .Since we are using findElements it returns multiple WebElements ..
@sindhusudhakaran1731
@sindhusudhakaran1731 3 жыл бұрын
Thank you Naveen
@anagamt1692
@anagamt1692 3 жыл бұрын
Great explanation
@21suhana
@21suhana 4 жыл бұрын
Hello Naveen, Thank you so much for doing excellent work..I've a requirement where I've to verify if all the links are working or if there is any broken links (404,500, etc)..I tried your code but unfortunately, it isn't working as it is supposed to.. I know few links have ISE(500) error and it still displays "Ok" message..Any lead to this would be highly appreciated..
@pandudamera7211
@pandudamera7211 6 жыл бұрын
BrokenLinkTest code is not available in Github
@myfrowards
@myfrowards 6 жыл бұрын
Gr8 explanation, thanks
@NidhiSharma-ir4ki
@NidhiSharma-ir4ki 4 жыл бұрын
Thanks a lot naveen ..
@praneethchakri7052
@praneethchakri7052 6 жыл бұрын
Thank you Naveen..
@swathijonnadula8585
@swathijonnadula8585 5 жыл бұрын
Please upload vidoes for automation testing using selenium with C#
@madhurinemade27
@madhurinemade27 5 жыл бұрын
But Img tag doesn't have href
@bipulhaldar2572
@bipulhaldar2572 4 жыл бұрын
Well Naveen I did not understand how you got 'href' property of 'img' element? As far as my understanding goes, 'img' elements do not support the 'href' or hyper-reference. The 'img' supports the 'src' property which is a link to the location where the image is to be found. Also to check whether the link to the 'img' element is broken or not we have the check the 'src' property and check whether it is returning an image or not.
@KOTHAABHISHEK
@KOTHAABHISHEK 4 жыл бұрын
Actually no need to search about img tag Because if we want to add a link we will use anchor tag only For image also we will use anchor tag only For example If we are getting a tag so automatically it will search this image link also.
@mohammedsorowarjahan490
@mohammedsorowarjahan490 6 жыл бұрын
Hi Naveen, I am not find this code at your 'SeleniumJavaCourse' repo. Can you pls upload?
@tejastoley6714
@tejastoley6714 5 жыл бұрын
right now there total 366 links out of which 346 are active.
@deepakdange5530
@deepakdange5530 2 жыл бұрын
Hi naveen....I excuted the codesame as you but it giving error....Cannot invoke "String.length()" because "spec" is null.......Plz provide solution
@masterdisaster1730
@masterdisaster1730 2 жыл бұрын
I am also facing same error , did you find any resolution ? Can you plz assist
@soumyarautaray4517
@soumyarautaray4517 Ай бұрын
Hi naveen....I excuted the codesame as you but it giving error.....MalformedURLException:Cannot invoke "String.length()" because "spec" is null.......Plz provide solution
@loquesea187
@loquesea187 6 жыл бұрын
Nice vid !!. One question, I am new to selenium but so far all the video tutorials Ive seen, always use a loop to get certain elements, why is that? it is better performance wise? Asking that because you can get all the "a" and "img" that has a href attribute with one cssSelector: a[href],img[href].
@shabnammustari4186
@shabnammustari4186 2 жыл бұрын
Hi Naveen.Thanks a lot for all learning videos. Im new to Java. I was following all the steps under this playlist. But somehow my TestNG is not working properly. I downloaded idk 17.0.1 version, selenium 4.0.0, is that's the issue? I noticed Selenium 4.0.0 version command are little different that you showed. What should I do this case. Also want to know is there any difference way I should do code my TestNG on Selenium 4.0.0 Please help me
@lakshaygarg4342
@lakshaygarg4342 6 жыл бұрын
Hi Naveen, I am getting an error "Connection time out : connect" in line code connection.connect(). Can you please help me to understand the reason of error.
@rockingrajashree1108
@rockingrajashree1108 5 жыл бұрын
Yes.. Naveen can u please explain as I'm also getting same error
@rajeshkumarmahto3106
@rajeshkumarmahto3106 5 жыл бұрын
I m also getting the same error. Please Naveen help us out from this.
@sandhyasanaka5200
@sandhyasanaka5200 6 жыл бұрын
Nice
@magheshsingaravelu2114
@magheshsingaravelu2114 3 жыл бұрын
One small clarification for img tag we need to take src attribute and for anchor tag we need to take href attribute is that correct?.
@stasbob2440
@stasbob2440 3 жыл бұрын
Hello Sir , there is one problem. It works but i need to do on a specific page . And it catches more url's than there is on that page by "a" tag name . Any thoughts what it might be related to ?
@Anand31187
@Anand31187 4 жыл бұрын
Hi Naveen, I am getting following exception while running the broken links code. Exception in thread "main" java.net.ProtocolException: Server redirected too many times (20) Can you help me to fixing this issue.
@GunjanBadjatya
@GunjanBadjatya 4 жыл бұрын
I m not getting status message as like ok or error like 40, only links it is printing. Kindly help.
@kollabathulasowjanya1610
@kollabathulasowjanya1610 6 жыл бұрын
thank u sir
@vpkori
@vpkori 3 жыл бұрын
Hi Naveen, can you please make Similar video using Python language.Thanks
@ManeendraBH
@ManeendraBH 4 жыл бұрын
Hi Mr. Naveen, Where is the website you always showing? freecrm.com? I am not getting that as you have shown.... :)
@surajmali4345
@surajmali4345 2 жыл бұрын
hii Sir, I am getting the SSLHandshakeException: PKIX path building failed error continuously (it works in some site and some sites getting this error)
@nagabhushan5994
@nagabhushan5994 3 жыл бұрын
Broken links & Images code is not available in the given git repository. Can anyone help me on this?
@bindunagaraj123
@bindunagaraj123 3 жыл бұрын
can i store all //a[@href] and //img[@src ] xpaths in a list and check if its not null get HttpURLConnection.. everything in 6 lines of code.
@ankitasomani2178
@ankitasomani2178 5 жыл бұрын
Hi Naveen..I am getting Exception while running program Exception in thread "main" java.net.UnknownHostException: www.freecrm.com and not able to find solution for this. Can someone please help.
@bharathkoneru4008
@bharathkoneru4008 5 жыл бұрын
I am also getting the same exception
@GauravSharma-bw4gu
@GauravSharma-bw4gu 4 жыл бұрын
Hi Naveen, Please put the BrokenLinksTest class code in GIT repository, unable to find that code in repository..
@ravikumar-lk5we
@ravikumar-lk5we 6 жыл бұрын
the most complex topic till yet i found....Little bit cofused sir
@kidscare4562
@kidscare4562 4 жыл бұрын
Hi Naveen thank you so much for this Section, am getting java.net.MalformedURLExecption: no protocal: (But that url formate is correct starting with ) Can you pls help me and one more am getting empty space while printing url ( first five url came one by one after that two lines space then 6 the url printing getting error at 6 the url)
@deepakwagh6722
@deepakwagh6722 2 жыл бұрын
Has that error got resolved
@umasalve8012
@umasalve8012 2 жыл бұрын
how to select second link from list of links without using linktext and partiallinktext in selenium
@rekhaacharya1108
@rekhaacharya1108 6 жыл бұрын
am unable to find the code please upload
@sumirozario904
@sumirozario904 5 жыл бұрын
Hi Naveen, I am getting below exception. Any Suggestion?? "javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed"
@deepakwagh6722
@deepakwagh6722 2 жыл бұрын
Can u please tell me how did u resolved the issue
@ayanbarua4461
@ayanbarua4461 3 жыл бұрын
Hello sir i am not able to find the code for broken links in the git repo, it will be great if it is available @naveen sir
@monil.joshi4
@monil.joshi4 3 жыл бұрын
How to do it recursively. One link has 10 other links inside it.
@Nandhis
@Nandhis 3 жыл бұрын
are the links separated using any delimiters?
@monil.joshi4
@monil.joshi4 3 жыл бұрын
@@Nandhis I am talking about nested links.. like if you go through aws or Android documentation you can see there are multiple hyperlink on the same page. So if I sum it up I am redirecting to home page then it 100 links out of which I navigate to first one it has another 50 links again I take first one out of 50 and it has some 20 links So how can I traverse and validate these 20 links then 50 links and validate same for rest of 99 out of 100 links
@Nandhis
@Nandhis 3 жыл бұрын
@@monil.joshi4 i got your point. Selenium will access only current page's web elements. It can't access recursively from other links like how you have mentioned. If you would like to do so, you need to open each link in new window/tab and then verify. That is going to be very tough for you. Instead, if you have access to your application's all APIs and if you could get all the links, that will be easier for you. Thanks!
@Starthene
@Starthene 4 жыл бұрын
Hey where do you find this code, I am not able to see this code in github
@alka240280
@alka240280 4 жыл бұрын
Thanks a lot for Awesome videos! I am getting malformed URL exception.Code is not working after getting list of active links.Please help.
@kumarwodeyar8884
@kumarwodeyar8884 4 жыл бұрын
Hi Naveen, code is able to find in git.. could you upload?
@arpitasmruti8247
@arpitasmruti8247 5 жыл бұрын
Hi Am getting Stale element reference exception Can anybody please help me out?
@sanjayym4503
@sanjayym4503 5 жыл бұрын
Stale (State is nothing but something not fresh) element reference exception occurs because of AJAX components / some time those components / elements get refreshed within the page that in turn generates new id . Here, Id is not normal id which you use for finding web elements. Just surround the code with try-catch block and re-identify the same element / object in the catch block then perform the action.
@sumitkumar9746
@sumitkumar9746 4 жыл бұрын
Program get struck saying - java.net.MalformedURLException: no protocol: , Any solution??
@sumitkumar9746
@sumitkumar9746 4 жыл бұрын
@Naveen: Please help it is very necessary for me...
@rockingrajashree1108
@rockingrajashree1108 5 жыл бұрын
Hi naveen.. Can you please explain how to click on all elements present in website????
@balabala6136
@balabala6136 5 жыл бұрын
Please reply to this.
@maheshtenapali8938
@maheshtenapali8938 5 жыл бұрын
can anyone help me ..am getting below error. how to resolve it ? Exception in thread "main" java.net.MalformedURLException: unknown protocol: javascript
@AjayKumar-ye2cu
@AjayKumar-ye2cu 5 жыл бұрын
I am also getting same exception. Anybody can help?
@rajsinghal05
@rajsinghal05 4 жыл бұрын
i m getting unauthorized , how to fix this
@karthikdeepan1998
@karthikdeepan1998 6 жыл бұрын
bro this works, but it struck at some point saying - java.net.MalformedURLException: no protocol: , Any suggestions??
@AjayKumar-ye2cu
@AjayKumar-ye2cu 5 жыл бұрын
i am also getting same exception.
@Srhnu449
@Srhnu449 5 жыл бұрын
naveen there is no such code in ur hit hub .. pls add it bro
@rekhaacharya1108
@rekhaacharya1108 6 жыл бұрын
how to avoid empty urls
@honeym6899
@honeym6899 6 жыл бұрын
am unable to find the code..please upload
@rekhaacharya1108
@rekhaacharya1108 6 жыл бұрын
am not able to find code
@harshakalluri03
@harshakalluri03 3 жыл бұрын
I will get job, I will donate something
@vasantvarma6406
@vasantvarma6406 4 жыл бұрын
Getting java.net.SocketTimeoutException
Architecture  of Page Object Model (POM) Design With Selenium - Part -1
35:26
Naveen AutomationLabs
Рет қаралды 866 М.
Why we should not mix Implicitly Wait and Explicit Wait in Selenium Script?
29:30
How I Did The SELF BENDING Spoon 😱🥄 #shorts
00:19
Wian
Рет қаралды 36 МЛН
ПОМОГЛА НАЗЫВАЕТСЯ😂
00:20
Chapitosiki
Рет қаралды 28 МЛН
Lehanga 🤣 #comedy #funny
00:31
Micky Makeover
Рет қаралды 29 МЛН
How to add Screenshot in Extent Report for Failed Test Cases in Selenium
54:04
Naveen AutomationLabs
Рет қаралды 76 М.
This Free AI System Will Create Unique Content in Seconds!
13:32
Hasan Aboul Hasan
Рет қаралды 145 М.
What are GetWindowHandle and GetWindowHandles in Selenium? | Selenium Basics
12:42
I've been using Redis wrong this whole time...
20:53
Dreams of Code
Рет қаралды 353 М.
How I Did The SELF BENDING Spoon 😱🥄 #shorts
00:19
Wian
Рет қаралды 36 МЛН