Taking a Screenshot using Selenium WebDriver in C# - Online Free Computer Tutorials.

'Software Development, Games Development, Mobile Development, iOS Development, Android Development, Window Phone Development. Dot Net, Window Services,WCF Services, Web Services, MVC, MySQL, SQL Server and Oracle Tutorials, Articles and their Resources

Wednesday, July 11, 2018

Taking a Screenshot using Selenium WebDriver in C#

It is always good to capture the screenshot of the test results if you are running the tests overnight. It is very easy and you may explicitly set the areas were you want to take the screenshot during the execution of automated tests and specify the save location. SOFTWARE REQUIREMENTS: Windows 7 as OS Microsoft Visual Studio 2010 as IDE NUnit as Unit Testing Tool Selenium as a Test Automation Tool Let me consider the test: Given I am on the Google home page When I search for text selenium Then I should see the search results I would be interested to take the snapshot in 2 locations: When the system inputs the search text in the search field Displaying of search results screen TEST EXECUTION INSTRUCTIONS: Refer my previous blog on Set-up instructions. Copy and paste the code snippet below into your Visual Studio 2010. Run the code using NUnit. Visit the image save location to view the screenshots (ex: C:\Users\anoops\Desktop\Screenshots in my case) using System; using System.Collections.


I guess you came to this post by searching similar kind of issues in any of the search engine and hope that this resolved your problem. If you find this tips useful, just drop a line below and share the link to others and who knows they might find it useful too.

Stay tuned to my blogtwitter or facebook to read more articles, tutorials, news, tips & tricks on various technology fields. Also Subscribe to our Newsletter with your Email ID to keep you updated on latest posts. We will send newsletter to your registered email address. We will not share your email address to anybody as we respect privacy.


This article is related to

Selenium,Test Automation,Agile,C#,NUnit,Visual Studio

No comments:

Post a Comment