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 - Third Edition
  • Table Of Contents Toc
  • Feedback & Rating feedback
Learning Selenium Testing Tools - Third Edition

Learning Selenium Testing Tools - Third Edition - Third Edition

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

Learning Selenium Testing Tools - Third Edition

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

CSS selectors

We saw in the previous section that XPath selectors can offer your tests a lot of flexibility to find elements on the page. Here, we will find the elements using CSS selectors (selectors are patterns used to select the elements you want to style.)

Note

It must be noted that Selenium IDE and Selenium RC use Sizzle, the framework used for selectors in jQuery, to find elements on the page. Not all of these can be translated to work in Selenium WebDriver.

Finding elements by CSS

We discussed that finding elements by XPath can be an extremely costly exercise. A way around this is to use CSS selectors to find the objects that you need. Selenium is compatible with CSS 1.0, CSS 2.0, and CSS 3.0 selectors. There are a number of items that are supported, such as namespace in CSS 3.0, and some pseudo classes and pseudo elements.

The syntax of your locator will look like css=cssSelector. Let's create our first selector to find an element on our page:

  1. Open Selenium IDE.
  2. Navigate to http...
Visually different images
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 - Third Edition
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