Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Learning Selenium Testing Tools
  • Table Of Contents Toc
Learning Selenium Testing Tools

Learning Selenium Testing Tools - Third Edition

By : Raghavendra Prasad MG
4.4 (11)
close
close
Learning Selenium Testing Tools

Learning Selenium Testing Tools

4.4 (11)
By: Raghavendra Prasad MG

Overview of this book

If you are a software developer with a basic knowledge of testing and are interested in automated testing using Selenium, this is the book for you. No prior knowledge of Selenium is required.
Table of Contents (17 chapters)
close
close
16
Index

Capturing screenshots

A lot of times, our Selenium remote control browsers run on different machines than the machine that performs tests. This is because you, as a developer or tester, need a mechanism to have a screenshot of what an error looks like when the test fails. The screenshots that are captured are saved in the PNG format.

Unfortunately, capturing screenshots in Selenium is limited to popular browsers such as Mozilla Firefox, Google Chrome, and Internet Explorer. This is because these browsers have libraries that Selenium can use to take screenshots. As more libraries are added to Selenium for different browsers, you will be able to take more screenshots. They will use the same API call so that there will be no need to change your tests.

The screenshot's capability lives within an interface called TakesScreenshot. We will cast the driver to this and then use the interface to access the getScreenshotAs() method. You also need to import the following library:

import static openqa...
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Learning Selenium Testing Tools
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon