Chapter 4

  1. Which are the different formats we can use to output a screenshot?

The OutputType interface support screenshot types in BASE64, BYTES, and FILE formats.

  1. How can we switch to another browser tab with Selenium?

We can switch to another browser tab using the driver.switchTo().window() method.

  1. True or false: The defaultContent() method will switch to the previously selected frame.

False. The defaultContent() method will switch to the page.

  1. What navigation methods are available with Selenium?

The Navigate interface provides to() , back() , forward() , and refresh() methods.

  1. How can we add a cookie using Selenium?

We can add a cookie using the driver.manage().addCookie(Cookie cookie) method.

  1. Explain the difference between ...

Get Selenium WebDriver 3 Practical Guide - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.