Selenium with C# 56 - How to capture full web page screenshot in Chrome & Firefox using selenium c#

  Рет қаралды 8,092

Ankpro Training

Ankpro Training

Күн бұрын

Пікірлер: 50
@AnkproTraining
@AnkproTraining 4 жыл бұрын
Cheers! would you mind hitting *_like_* button and *_subscribe_* to our channel! That will be awesome. We would be grateful to you. And also share this video in your circle via whatsapp, facebook and twitter.
@HypnotizedSeduction
@HypnotizedSeduction 2 жыл бұрын
Is it possible to take screen shots at specific resolutions?
@AnkproTraining
@AnkproTraining 2 жыл бұрын
Yes. Adjust the browser width and height as you wish and take the screenshot. Thank you for watching this video and commenting. Don't forget to *_like, subscribe_* and hit that *_notification_* bell 🔔
@promaster6310
@promaster6310 2 жыл бұрын
do you have method for screenshoot element?
@AnkproTraining
@AnkproTraining 2 жыл бұрын
Yes, watch this video, kzbin.info/www/bejne/p4bSqYiaidKhnZY Thank you for watching this video. Don't forget to *_like , subscribe_* and hit that *_notification_* bell 🔔. And also share this video in your circle via *WhatsApp* , *Facebook* and *Twitter* . Link to subscribe the channel goo.gl/hFueBi
@ronanbreen1772
@ronanbreen1772 2 жыл бұрын
Hi, I'm using below snippet which works fine locally i.e. returns full page screenshot by scrolling and combining multiple screenshots but when I run on Selenium Grid it either returns no screen or just the standard screen. Any Suggestions. VerticalCombineDecorator vcd = new VerticalCombineDecorator(new ScreenshotMaker()); WebDriver.TakeScreenshot(vcd).ToMagickImage().Write(fileLocation, ImageMagick.MagickFormat.Png); Cheers.
@AnkproTraining
@AnkproTraining 2 жыл бұрын
Make sure all required dlls are copied.
@pavankumar-qc3dg
@pavankumar-qc3dg 4 жыл бұрын
I am facing issue "Cannot convert from selenium_complete .verticalCombineDecarator to WDSE.Interfaces.IScreenshotStrategy" I could not found any parameter for Takescreenshot() in Extension methods in VS 2017
@AnkproTraining
@AnkproTraining 4 жыл бұрын
Have you included WDSE namespace?
@AnkproTraining
@AnkproTraining 4 жыл бұрын
Code is available in the video description.
@RobervalBergamoJunior
@RobervalBergamoJunior 4 жыл бұрын
Hello, is there a way for the screenshot to also display the URL? Because I have a situation, where when switching from one link to another, the system leaves QA and enters Prod. Thanks
@AnkproTraining
@AnkproTraining 4 жыл бұрын
You can log the url from below statements string url=driver.Url; Console.WriteLine(url); Or if you are using logger you can use log.Write(url); As part of the screenshot you will not get address bar.
@chandanchatterjee9822
@chandanchatterjee9822 4 жыл бұрын
I m trying this with Internet Explorer Driver but it's not working is there any additional steps to be taken for IE
@manasapapani_2222
@manasapapani_2222 Жыл бұрын
am getting this error (Javascript error :$ is not defined)when am using this code,can you please help me out
@madhujangra892
@madhujangra892 3 жыл бұрын
This won't work as expected if page has fixed header or footer. in that case it looks like combination of multiple pages instead of one page.
@carlconn2453
@carlconn2453 4 жыл бұрын
Could not find ToBitmpa as well. Using .net Core and Selenium 3. USINGS: using System.Drawing; using WDSE; using WDSE.Decorators; using WDSE.ScreenshotMaker; CODE: VerticalCombineDecorator vcd = new VerticalCombineDecorator(new ScreenshotMaker().RemoveScrollBarsWhileShooting()); Driver.TakeScreenshot(vcd).ToMagickImage().ToBitmap().Save("newChrome.png");
@riyazuddinhyder2609
@riyazuddinhyder2609 4 жыл бұрын
Sir, How to crop the element alone and capture the screenshot
@AnkproTraining
@AnkproTraining 4 жыл бұрын
Hi Riyaz, You can follow below video to capture a screenshot of the single element. kzbin.info/www/bejne/p4bSqYiaidKhnZY Cheers! would you mind hitting *_like_* button and *_subscribe_* to our channel.
@benoyvarughese8156
@benoyvarughese8156 4 жыл бұрын
Hi, Very Nice video and it was very much useful. But when i did the same i got this error : Reference to type 'IMagickImage' claims it is defined in 'Magick.NET-Q8-AnyCPU', but it could not be found. I am using .NET Framework 4.6.1 and download the Noksa 0.1.5.3 as you said the tutorial. previously
@AnkproTraining
@AnkproTraining 4 жыл бұрын
Try downgrading the project .net Framework version to 4.5.x
@benoyvarughese8156
@benoyvarughese8156 4 жыл бұрын
@@AnkproTraining Thanks . It is working when i tried with 4.5.2
@AnkproTraining
@AnkproTraining 4 жыл бұрын
@@benoyvarughese8156 Thank you for watching this video and commenting. Cheers! would you mind hitting *_like_* button and *_subscribe_* to our channel! That will be awesome. We would be grateful to you. And also share this video in your circle via whatsapp, facebook and twitter.
@darsi567
@darsi567 4 жыл бұрын
Does this method work on .net core 3.1?
@1bc12345
@1bc12345 4 жыл бұрын
Looks like it's not working.Is it working for you?
@nidhigarg3707
@nidhigarg3707 3 жыл бұрын
No not working in .netcore 3.1
@AnkproTraining
@AnkproTraining 3 жыл бұрын
@@1bc12345 .NET Core tip: Do not use .ToBitmap().Save("newChrome.png") Try to use method .Write(filePath, ImageMagick.MagickFormat.Png) instead Example: driver.TakeScreenshot(vcd).ToMagickImage().Write("newChrome.png", ImageMagick.MagickFormat.Png)
@AnkproTraining
@AnkproTraining 3 жыл бұрын
@@nidhigarg3707 .NET Core tip: Do not use .ToBitmap().Save("newChrome.png") Try to use method .Write(filePath, ImageMagick.MagickFormat.Png) instead Example: driver.TakeScreenshot(vcd).ToMagickImage().Write("newChrome.png", ImageMagick.MagickFormat.Png)
@AnkproTraining
@AnkproTraining 3 жыл бұрын
.NET Core tip: Do not use .ToBitmap().Save("newChrome.png") Try to use method .Write(filePath, ImageMagick.MagickFormat.Png) instead Example: driver.TakeScreenshot(vcd).ToMagickImage().Write("newChrome.png", ImageMagick.MagickFormat.Png)
@piyush007verma
@piyush007verma 4 жыл бұрын
ToBitmap() unable to get this function even after adding all references, please suggest
@AnkproTraining
@AnkproTraining 4 жыл бұрын
Include System.Drawing Namespace. Issue should be resolved. Let us know, you were able to get the full page screenshot. And also make sure you have added using WDSE statement. Let me know whether this worked or not.
@vladimirh.5934
@vladimirh.5934 4 жыл бұрын
I got the same issue with "ToBitmap()". Error Message: Error CS1061 "IMagickImage" does not contain a definition for "ToBitmap" and no accessible ToBitmap extension method could be found which accepts a first argument of type "IMagickImage" (possibly a using directive or assembly reference is missing).
@carlconn2453
@carlconn2453 4 жыл бұрын
same issue. used System.Drawing
@AnkproTraining
@AnkproTraining 3 жыл бұрын
@@carlconn2453 .NET Core tip: Do not use .ToBitmap().Save("newChrome.png") Try to use method .Write(filePath, ImageMagick.MagickFormat.Png) instead Example: driver.TakeScreenshot(vcd).ToMagickImage().Write("newChrome.png", ImageMagick.MagickFormat.Png)
@AnkproTraining
@AnkproTraining 3 жыл бұрын
@@vladimirh.5934 .NET Core tip: Do not use .ToBitmap().Save("newChrome.png") Try to use method .Write(filePath, ImageMagick.MagickFormat.Png) instead Example: driver.TakeScreenshot(vcd).ToMagickImage().Write("newChrome.png", ImageMagick.MagickFormat.Png)
@arkadiuszgajewski5867
@arkadiuszgajewski5867 3 жыл бұрын
.NET Core tip: Do not use .ToBitmap().Save("newChrome.png") Try to use method .Write(filePath, ImageMagick.MagickFormat.Png) instead Example: driver.TakeScreenshot(vcd).ToMagickImage().Write("newChrome.png", ImageMagick.MagickFormat.Png)
@manasapapani_2222
@manasapapani_2222 Жыл бұрын
@arkadiuszgajewski5867 am getting this error (Javascript error :$ is not defined)when am using this code,can you please help me out
@kunalagarwal2875
@kunalagarwal2875 4 жыл бұрын
i am facing a issue ToBitmap() function is not working
@AnkproTraining
@AnkproTraining 4 жыл бұрын
Include System.Drawing Namespace. Issue should be resolved. Let us know, you were able to get the full page screenshot.
@AnkproTraining
@AnkproTraining 3 жыл бұрын
.NET Core tip: Do not use .ToBitmap().Save("newChrome.png") Try to use method .Write(filePath, ImageMagick.MagickFormat.Png) instead Example: driver.TakeScreenshot(vcd).ToMagickImage().Write("newChrome.png", ImageMagick.MagickFormat.Png)
@1bc12345
@1bc12345 4 жыл бұрын
ToBitmap().Save is not working even I have added all name spaces as mentioned in the Description
@AnkproTraining
@AnkproTraining 4 жыл бұрын
Paste the error message here
@1bc12345
@1bc12345 4 жыл бұрын
@@AnkproTraining When I tried the below code in .NetCore Framework, ToBitmap() method is not showing in the list and Save also not showing up.I tried using ToBase64() method but still Save method is not showing and screenshot is not saved to my local.Please hlep me on this? VerticalCombineDecorator vcd = new VerticalCombineDecorator(new ScreenshotMaker().RemoveScrollBarsWhileShooting()); driver.TakeScreenshot(vcd).ToMagickImage().ToBitmap().Save("newChrome.png");
@AnkproTraining
@AnkproTraining 4 жыл бұрын
@@1bc12345 include below lines, using WDSE; using WDSE.Decorators; using WDSE.ScreenshotMaker; If you are not getting the methods lets know.
@1bc12345
@1bc12345 4 жыл бұрын
@@AnkproTraining Thanks for the reply I have already used those methods,still not getting Save method.
@nidhigarg3707
@nidhigarg3707 3 жыл бұрын
@@AnkproTraining this doesnt work for .netCore3.1 is their a solution for that?
Selenium WebDriver Tutorials with C#
24:22
Mukesh otwani
Рет қаралды 114 М.
Quilt Challenge, No Skills, Just Luck#Funnyfamily #Partygames #Funny
00:32
Family Games Media
Рет қаралды 55 МЛН
Chain Game Strong ⛓️
00:21
Anwar Jibawi
Рет қаралды 41 МЛН
Selenium WebDriver Tutorial #38 - How to Take Screenshot in Selenium
14:42
Software Testing Mentor
Рет қаралды 65 М.
ASP.NET Core Crash Course - C# App in One Hour
1:00:44
freeCodeCamp.org
Рет қаралды 1,6 МЛН
C# Tutorial 61:How to capture the screenshot of desktop using C#
13:31
ProgrammingKnowledge
Рет қаралды 40 М.