-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
Selenium Testing Tools Cookbook Second Edition
By :
Selenium WebDriver provides the WebElement interface to work with various types of HTML elements. It also provides helper classes to work with the Select element. However, there is no built-in class to support the web tables or the <table> elements. In this recipe, we will implement a helper class for web tables. Using this class, we will retrieve properties and perform some basic operations on a web table element.
Create a new Java class WebTable.java, which we will use to implement support for the table elements.
Let's implement the web table extension code with WebTable.java using the following steps:
Add a constructor for the WebTable class, and for the setter and getter property methods as well. The WebTable constructor will accept the WebElement object, as shown in the following code:
package com.secookbook.examples.chapter09; import org.openqa.selenium.NoSuchElementException; import org.openqa.selenium.WebElement...
Change the font size
Change margin width
Change background colour