Hi Mukesh, with this video I have learned How to capture Screenshot. I am following your videos as you provided the links in your blog( Basic, Advanced). meanwhile, I am preparing interview questions topic wise. Thank you for sharing the resume template.
This is the best tutorial I have found so far. Each word in the program has been explained with detail. Thank you very much sir for uploading this series.
Thanks for this video, Nice explanation with more information, very helpful to interested people want learn own (online)... You are doing a great job!!! Keep going.....................................................
Hi Siyar, you can also watch next video where we take screenshot whenever test fails learn-automation.com/how-to-capture-screenshot-for-failed-test-cases-in-selenium-webdriver/
Simply Awesome Mukesh. I like it very much. The way of presentation of subject is really good. Explaing the java concepts whever required in is very helpful. Thanks alot.
Hi Mukesh it is a very owsm explanation. As u say in the last we can add a screenshot in the report so please send me the url of those video in which i can learn how can take screenshot in the report.
Hello Mukesh, Thank you for uploading all these resourceful video. I am having an issue which not able to get copyFileToDirectory(File srcFile, File destDir) for FileUtils class. What should I do? Note: my project is maven project and I have added commons-io plug in. Thanks in advance for any help.
Hey mukesh, just a quick question- If my program is running in multiple data , lets say i have 5 userid's and password for facebook login , how would i take screenshot for all instances, if my program is common for all datas
Hi Mukesh. Thanks for your wonderful video .Can you help out out please .I am trying to do screenshot but is showing me error my code is below TakesScreenshot ts=(TakesScreenshot)driver; File src=ts.getScreenshotAs(OutputType.FILE); FileUtils. Dot is not working thanks
Thanks alot for creating an easy to understand and precise video.I am new to java and selenium and am curious to know why we did not create a constructor and then passing Webdriver driver as a parameter while creating a liabrary?
Hi Mukesh, Your tutorials are really good and easy to understand. I am beginner in Selenium and with your tutorials I am to understand it well. I am facing the below issue while trying out for capturing SS: I created folder in project for captured screenhot same as given in vedio. But when double clicking it, the png file is not getting opened. Please help me ,what else need to do. Also, if I save screenhot in some other drivers ,the .png file is getting opened.
Hey Bud, I've just started learning automation. Could do basic stuff but you took my automation skills to the next level. Thank you so much. Can i please get a contact so i can get in touch if required? Manish
+Manish Kohli HI Manish thank you. I am glad you liked this. You can contact me anytime and you can get my details from my website. learn-automation.com/
Sir ur videos are really good and it helped me alot but i want to ask that how it is taking screenshot of full page even if its not showing full.page ......
Hi Mukesh, Your videos are very neat. You are a great teacher. I can see your effort in bringing all scenarios into videos. Thank you so much for that. I am trying to take screen shot. I am able to take a screen shot. But when i try to open, the file, it is full of junk characters instead of screen shot. How to address this.
Hi Mukesh, This is a good tutorial to understand how to capture screen shots using selenium web driver. But, I am finding the error when I run teh same code that you show on your video, I am not using TestNG but java.
Hi, Mukesh. I've just subscribed your channel. I'm a beginner in automation too.. I'd like to know if you have any tip or if you know free courses or tutorials that could lead me to learn and improve my knowledge... (through your channel too.. which vid in specific to start?). Thanks in advance.
Thanks Mukesh ...nice explaination. I wanna ask u one thing that in my case I am using date and time to be kept as part of screenshot file name. Is there any other possible way to call screenshot method every time after each step. i dont want to call it after every step.
Hi Mukesh, First of all Thanks a ton for the excellent vedios. I have been unable to view your vedios recently. I get Udemy ads infinitely and the learning vedio doesnt work. This is happening since last few days. Kindly help me if there is a solution to this.
Good work, man! I watched this and some of your other videos; real good work. I am still trying to figure out if screen captures are possible with FirefoxDriver in headless mode.
Hi Mukesh, Can we do image comparision and text comparison on same image using selenium? If not what is the best tool with selenium to compare image and text on image
Thank you Mukesh San. Your vids have been really helpful. For screenshots is there any way to get screenshot of complete scrollable webpage and not just the display area?
Hi Tasneem, In MAC i follow below steps. learn-automation.com/firefox-browser-on-mac-using-selenium-webdriver/ For Windows you can put them in System env variables.
Hi Mukesh, I am getting this error in FAILURE EXCEPTION "java.io.IOException: Source 'C:\Users\Adarsh\AppData\Local\Temp\screenshot5434601471001346629.png' exists but is not a directory" after following the same steps in the first half of the video. Please help.
Hi Mukesh, I tried to used in TestNG, be dnt knw where to get Utility library from, as it is not giving me autosuggestions for Utility.capturescreenshot??
Thanks for this tutorial. I have just started learning selenium. I found FirePath is not working and i heard there is a better xpath tool ChroPath, could you please make tutorial for ChroPath tool. Thank you.
Hi Mukesh, I have quick question about capture screenshot by using TestNG Listener , as we know if test case failed we need to take screen shot for sending report to developers to fix the specific issue. How can we do Draw Border or Change Color or Flash any specific Web Elements Failure with screenshot & send to developers by using TestNG Listener. Thanks
It was really awesome teaching.. Kindly let me where can I find for the validation of pages or links or data with this use of Page Object Model? I mean do we need to validate in test case or java class?
source is just a reference variable, you can name it anything like xyz, abc. In next statement we need to use this variable and store screenshot in local disk. Use FileHandler class as well for storing screenshot learn-automation.com/how-to-use-filehandler-class-in-selenium-for-screenshot/
Hi Mukesh, Thank u for uploading this video but doing same code but there is exception like Exception while taking screenshotDestination '.\Resources\BrowesrOpen.png' exists but is a directory so what to do
Hi Paresh, Please check the path again. Its path issue only. use below code ./yourlocalfoldername/screenshot name.png or you can give full path where you need to store the password like C:\\Folder\ ame.png or C:/Folder/name.png
Thanks for the video Mukesh. it was very helpful . I have some issue in viewing images. can you able to help me with that. I selected Preferences > General > Editors > File Associations and added Assosciated editor specifying external program as PNG IMAGE.But I still see my eclipse displaying png file as text file. when i go back and check my assosciated editor i dont see the one which i added. Can you help me with this. (I am using eclipse mars version)
Hi Mukesh, Great video..good work. I have a question on FileUtils method. I am not able to use it as it is not showing any suggestion. I have already added Apache POI lib to access commons methods, still no luck. Please suggest. Regards, Ritu Pathak
Hi Ritu, In Selenium latest version you won't get commons-io (for screenshot) so we need to add explicitly. Please try and let me know if still any issue commons-io commons-io 2.6
Hi Mukesh, Could you please post video on How to get multiple Screen Shot and save it in a Word document im a beginner tester, and I need to capture all the process of a web app, i need your help
Hi Mukesh, While taking screenshot of a static page, I am getting the screenshot perfectly in a drive(D or E) but coming as text although it has .png or .jpg extension in the folder created under a project. Can you please explain this issue. Thanks, Debi
Hi Mukesh, with this video I have learned How to capture Screenshot. I am following your videos as you provided the links in your blog( Basic, Advanced). meanwhile, I am preparing interview questions topic wise. Thank you for sharing the resume template.
Superb explanation Mukesh... Crip n Clear !
Thank you so much for your explanation.you clear my doubts in each and every line as well how to utilize the code in all the way.
Hi Aruna I am happy to read your comment. Keep learning.
It worked for me. Thanks.
import java.io.File;
import java.io.IOException;
import org.openqa.selenium.OutputType;
import org.openqa.selenium.TakesScreenshot;
File scrnshot = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
FileHandler.copy(scrnshot, new File("folder structure" +driver.getTitle()+".png"));
Wow.... Very clear and excellent explanation.. you saved me... Thank-you so much !!
HI Aastha thank you so much for such a nice comment.. It means a lot to me. Keep learning.
Your video is so good. Thank you so much
Hi Mukesh,
Thank you so much. Easy to understand all concept about how to take a screenshot. Thank you again.
.
about u r commitment on automation frame work... no words to say..... bt marvelllous, fantastic, beautiful... thank u so much mukesh.. keep it up
+satish narayana Thanks you Satish :)
Thanks Mukesh for explaining it so clearly ....
Welcome Preeti Keep visiting. Happy Weekend.
so nicely explained , i have to try out in practicals but very well explained .
This is the best tutorial I have found so far. Each word in the program has been explained with detail. Thank you very much sir for uploading this series.
Thank you so much Nayan 🙏
Thank you for these videos Mukesh. I recently started learning Java and Selenium and your videos are proving to be very helpful for me.
Thanks Gowri :) keep watching
Your video is really very helpful. Superb :)
Thanks for this video, Nice explanation with more information, very helpful to interested people want learn own (online)...
You are doing a great job!!! Keep going.....................................................
+Shashi Shashi Thanks Shashi
very nice explanation....clear and crisp...!!
+Shiba Poppli thnks Shiba
Useful video.......Thanks Mukesh :)
Teaching method is really nice...keep it up
Thanks mate
Mukesh bhai,,,, just amazing... u r superv yaar.... hats off.... please keep uploading more n more videos.....god bless u...
+MrMadhur14g Hi Madhur thank you keep visiting and let me know if I can help you in Selenium
wonderful explanation thanks mukesh
You're most welcome Snig Shine
Short and best explanation ✌
Detailed explanation Mukesh!! Good job
thank You
thank You
I love it. Now I got how to take screenshots. Thnx Mukesh!
Hi Siyar, you can also watch next video where we take screenshot whenever test fails learn-automation.com/how-to-capture-screenshot-for-failed-test-cases-in-selenium-webdriver/
FileUtils.copyFile() is not woking what to next in selenium 3
Simply Awesome Mukesh. I like it very much. The way of presentation of subject is really good. Explaing the java concepts whever required in is very helpful. Thanks alot.
+chandra Sekhar Thank you Chamdra :)
ಸ್ಕ್ರೀನ್ ಶಾಟ್ ಮಾಡುವುದು ಹೇಗೆ.
Hi Mukesh it is a very owsm explanation. As u say in the last we can add a screenshot in the report so please send me the url of those video in which i can learn how can take screenshot in the report.
brilliant Job Mukesh!!
+aamir mushtaq Thanks :)
Thanku sir
Ur the best selenium guideline
Thanks Sagar Shinde :) Keep learning..
Mukesh, thanks for "Interface" explanation.............
I did not know, we can't create OBJECT for interface.
+Nagag Salka We can not create object of Interface because as per java until your class is not fully implemented we can not create object.
Hi Mukesh,
Thanks for this video, very helpful...
You are doing a great job!!!
Thanks a lot..
+Rama Devi HI Rama thank you :) Keep watching.
U r explaining awesome sir step by step
Thanks Sandhya. For code and everything you can check below links
learn-automation.com/how-to-capture-screenshot-in-selenium-webdriver/
Good Explanation.
It is really very helpful . Thanks Mukesh :)
thanx Bhagyshree keep visiting and let me know if any help required from my end
Thank you for this tutorial, very well explained.
Good Work Mukesh.. only one thing i replaced and it worked fine for my code
FileHandler.copy(Source, new File("./ScreenShots/popup.png"));
i like it very much....nice vedio......keep it up ...........please share ......how we do data validation in webdriver......Thanks a lot
+dayanidhi bisoyi Hi Dayadihi, what do you mean by data validation? If you can explain in brief then I can help you.
Hi Mukesh,
This is really helpful.
I have one query : How do we take screenshot of a full page with scrolling?
Hi Surbhi, did you get the solution for this?
Hello Mukesh, Thank you for uploading all these resourceful video. I am having an issue which not able to get copyFileToDirectory(File srcFile, File destDir) for FileUtils class. What should I do? Note: my project is maven project and I have added commons-io plug in. Thanks in advance for any help.
HI Fahim, From Selenium 3.6 you can use FileHandler class learn-automation.com/how-to-use-filehandler-class-in-selenium-for-screenshot/
@@Mukeshotwani Got it. Thanks Mukesh.
Very nice Video. Nice job Mukesh,
Viki Viky tnnx Viky
Hey mukesh, just a quick question-
If my program is running in multiple data , lets say i have 5 userid's and password for facebook login , how would i take screenshot for all instances, if my program is common for all datas
Viki Viky just after ur test call screenshot method (lib which we created)
thanks
Hello Mukesh,
I was wonder if you any any interview banks?
Hi Mukesh.
Thanks for your wonderful video .Can you help out out please .I am trying to do screenshot but is showing me error my code is below
TakesScreenshot ts=(TakesScreenshot)driver;
File src=ts.getScreenshotAs(OutputType.FILE);
FileUtils.
Dot is not working
thanks
Thank you so much putting this much effort for this Mukesh. May God bless you..!
+Nayanajith Bandara Thank you so much Nayanajith Happy weekend.
Thanks alot for creating an easy to understand and precise video.I am new to java and selenium and am curious to know why we did not create a constructor and then passing Webdriver driver as a parameter while creating a liabrary?
Mukesh , did u have the video on how to get multiple Screen Shot and save it in a Word document which was request below???? i also need it
very helpful.Thanks
Welcome Aruna. Keep visiting.
Excellent
Thanks Towhid
Superb!!!
Hi Mukesh,
Your tutorials are really good and easy to understand. I am beginner in Selenium and with your tutorials I am to understand it well.
I am facing the below issue while trying out for capturing SS:
I created folder in project for captured screenhot same as given in vedio. But when double clicking it, the png file is not getting opened. Please help me ,what else need to do.
Also, if I save screenhot in some other drivers ,the .png file is getting opened.
Hi Madhavi, yes if you want to open png file in Eclipse then right click on png file > Open with > System Editor or Web Browser.
Excelent explication
Thanks Juan :) Keep learning and let me know if any help required from my side.
Super.....................
thnx
Hey Bud, I've just started learning automation. Could do basic stuff but you took my automation skills to the next level. Thank you so much. Can i please get a contact so i can get in touch if required? Manish
+Manish Kohli HI Manish thank you. I am glad you liked this. You can contact me anytime and you can get my details from my website.
learn-automation.com/
Mukesh can u please share complete details on assertions.and how we can use in our projects
HI Sneha, I have 2 videos on Assertion on my channel.Pleas check Assert and Soft Assert on my channel.
Sir ur videos are really good and it helped me alot but i want to ask that how it is taking screenshot of full page even if its not showing full.page ......
Hi Mukesh,
Your videos are very neat. You are a great teacher. I can see your effort in bringing all scenarios into videos. Thank you so much for that.
I am trying to take screen shot. I am able to take a screen shot. But when i try to open, the file, it is full of junk characters instead of screen shot. How to address this.
+GS Nunna Thanks Nunna 👌🏻🙏 right click on png file and open with web browser or system editor
gotcha :-)
Hi Mukesh,
This is a good tutorial to understand how to capture screen shots using selenium web driver. But, I am finding the error when I run teh same code that you show on your video, I am not using TestNG but java.
Hi, Mukesh. I've just subscribed your channel. I'm a beginner in automation too.. I'd like to know if you have any tip or if you know free courses or tutorials that could lead me to learn and improve my knowledge... (through your channel too.. which vid in specific to start?). Thanks in advance.
awesome explanation!!
+Moni Mathur Hey Moni happy learning :)
Thanks, it worked
Cheers Raza
wht u make the utility method as static
Thanks Mukesh ...nice explaination. I wanna ask u one thing that in my case I am using date and time to be kept as part of screenshot file name. Is there any other possible way to call screenshot method every time after each step. i dont want to call it after every step.
Yes Rajat, you can. You can use WebDriverListener.
thanks mukesh
Welcome Manas.. Keep visiting.
Hi Mukesh,
First of all Thanks a ton for the excellent vedios.
I have been unable to view your vedios recently. I get Udemy ads infinitely and the learning vedio doesnt work. This is happening since last few days. Kindly help me if there is a solution to this.
Good work, man! I watched this and some of your other videos; real good work. I am still trying to figure out if screen captures are possible with FirefoxDriver in headless mode.
Hi ,
I have worked on PhantomJS headless mode so I was able to capture screenshots. Just give a try with PhnatomJS
Alrighty then. Thanks again!
Hi Mukesh,
Can we do image comparision and text comparison on same image using selenium?
If not what is the best tool with selenium to compare image and text on image
Hi Tammireddy, Selenium can capture screenshots only but using Tesseract OCR you can read images too ruclips.net/video/5DqW9KP-aQo/видео.html
Thank you Mukesh San. Your vids have been really helpful. For screenshots is there any way to get screenshot of complete scrollable webpage and not just the display area?
Hey manmit by default Selenium will take complete screenshot only :)
Hi Mukesh.
Very informative tutorial. Can you please tell how we can avoid hard coding thing for chrome browser everytime?
Hi Tasneem,
In MAC i follow below steps.
learn-automation.com/firefox-browser-on-mac-using-selenium-webdriver/
For Windows you can put them in System env variables.
Can you please help,how to take screenshots of entire page if page is huge and requires scrolling down?
Did you record yours codes in GITHUB?
Hi Malikah, try this from your end and let me know if you face any issue.
How can we take screenshots of application, when web page change and paste in word document? In my code it's replacing last one
Amazing
Thank you! Cheers! Deepanshu
Hi Mukesh, I am getting this error in FAILURE EXCEPTION "java.io.IOException: Source 'C:\Users\Adarsh\AppData\Local\Temp\screenshot5434601471001346629.png' exists but is not a directory" after following the same steps in the first half of the video. Please help.
First of all congrat for your work!!... I'm facing a problem, why the highlight do not appear in my screenshot??
Hi Silvio, highlight part is using JS so in screenshot it will not capture.
Which is better way-- capture screenshots in AfterMethod annotation or with listeners?? And, why??
Hi Kshipra, you can use both. Depends on your requirement you can use any of them. You can use extent report with listeners.
Hi Mukesh, I tried to used in TestNG, be dnt knw where to get Utility library from, as it is not giving me autosuggestions for Utility.capturescreenshot??
Hi Richa,
We have created our own library and used it, You can also create n number of the library which you can use to reuse the code.
Thanks for this tutorial. I have just started learning selenium. I found FirePath is not working and i heard there is a better xpath tool ChroPath, could you please make tutorial for ChroPath tool. Thank you.
Thank You Sir.
Welcome Gajanan
Hallo.. nice video. I want to know why we want libraries, in first step we can also take screenshot then why we can create utility for that????
We use or create library so that we can reuse them.
thanks sir....
Hello Mukesh,
Which version of Selenium are we using in your tutorials?
2.53.1
Mukesh otwani Is it very different from 3.0?
hi mukesh..
im not able to use Utility library pls suggest me..when im using using Utility it shows red mark.
Hi Mukesh,
Please provide the link in which you have explained to take screenshot and attach it to report
Hi Mukesh,
I have quick question about capture screenshot by using TestNG Listener , as we know if test case failed we need to take screen shot for sending report to developers to fix the specific issue.
How can we do Draw Border or Change Color or Flash any specific Web Elements Failure with screenshot & send to developers by using TestNG Listener. Thanks
Excellent tutorial,, very easy to understand. Can you send me link of screen shot for failed test cases?
Thanks Sunil I have another video for this kindly check.
Thank you Mukesh
Welcome Sunil
It was really awesome teaching.. Kindly let me where can I find for the validation of pages or links or data with this use of Page Object Model? I mean do we need to validate in test case or java class?
You can validate in Pages. Kindly refer my page object model video
Good
Thanks Buddy, Whats your name?
How can we do File source=ts.getScreenshotAs(OutputType.FILE).source is an object or variable?how can object store a file
source is just a reference variable, you can name it anything like xyz, abc. In next statement we need to use this variable and store screenshot in local disk.
Use FileHandler class as well for storing screenshot learn-automation.com/how-to-use-filehandler-class-in-selenium-for-screenshot/
Thakyou so much bye
Hi Mukesh,
Thank u for uploading this video but doing same code but there is exception like
Exception while taking screenshotDestination '.\Resources\BrowesrOpen.png' exists but is a directory
so what to do
Hi Paresh,
Please check the path again. Its path issue only.
use below code
./yourlocalfoldername/screenshot name.png
or you can give full path where you need to store the password
like C:\\Folder\
ame.png or C:/Folder/name.png
Thank u sir....
hi, did you check in the code any where?
i am looking forward to compare the images. if possible pls share the details
thanks
+Laxmi Rukka Hi Laxmi, its possible in Sikuli.
PLease have a look to Sikuli.
Thanks for the video Mukesh. it was very helpful . I have some issue in viewing images. can you able to help me with that. I selected Preferences > General > Editors > File Associations and added Assosciated editor specifying external program as PNG IMAGE.But I still see my eclipse displaying png file as text file. when i go back and check my assosciated editor i dont see the one which i added. Can you help me with this.
(I am using eclipse mars version)
Hi Pav, It should open ideally but anyways you can check all screenshot in local drive.
Hi Mukesh,
Great video..good work. I have a question on FileUtils method.
I am not able to use it as it is not showing any suggestion. I have already added Apache POI lib to access commons methods, still no luck.
Please suggest.
Regards,
Ritu Pathak
Hi Ritu,
In Selenium latest version you won't get commons-io (for screenshot) so we need to add explicitly.
Please try and let me know if still any issue
commons-io
commons-io
2.6
Thank you, it is working fine now.
Can you tell me why the eclipse didn't give an error while mentioning the screenshot path? It should accept \\(Double slash) in String, right?
Hi Anand,
Java supports both / and \\ so it should not give any error.
Hi Mukesh,
From where we need to import FileUtil class ?
Hi Mukesh,
Is it possible to automate siebel application using Selenium.
I work on siebel application.As of now i do manually.
Thanks.
+KHEL KHEL MEIN not sure because not tried till yet.
If it is on web then yes we can do that
Hi
I want to know about the procedure how to take screenshots using listener. Could you guide me plz.
Hi Deba,
I have explained the same concept in blog kindly check and implement the same learn-automation.com/what-is-listeners-in-selenium-webdriver/
Hi, How to open hyperlink in new tab and take screenshot. of new open tab
updated code in java for screenshot
TakesScreenshot ts= (TakesScreenshot)driver;
File source=ts.getScreenshotAs(OutputType.FILE );
FileHandler.copy(source,new File("./ScreenShot/"+screenshot+".png"));
System.out.println("screenshot taken");
Hi Mukesh, Could you please post video on How to get multiple Screen Shot and save it in a Word document im a beginner tester, and I need to capture all the process of a web app, i need your help
is this a requirement or you just exploring this.
Is a requirement, I need to take multiple screen shot of every page and save it in a Word file
Hi..How to use directly webdriver driver=new firefox driver... Without using set property
can you make one video hoW to use GItHUB
Hi Mukesh,
While taking screenshot of a static page, I am getting the screenshot perfectly in a drive(D or E) but coming as text although it has .png or .jpg extension in the folder created under a project.
Can you please explain this issue.
Thanks,
Debi
+Debiprasad Panda right click open as system editor
Yes it opened...but i have to go for such a step always then... It was not there in your case. Can you please help me here
Hi! Mukesh, how can I make a screenshot of full-page by selenium 3?
can i do without using TestNg
hi mukesh can you please tell me how to capture the partial/selected portion of image as a screen shot.
Hi Mani,
Below post will guide you for the same www.software-testing-tutorials-automation.com/2015/01/how-to-capture-element-screenshot-using.html
Hi Mukesh,
How to capture screenshot using base64?