From the course: Scripting for Testers
Unlock the full course today
Join today to access over 22,400 courses taught by industry experts or purchase this course individually.
Selenium navigation - Python Tutorial
From the course: Scripting for Testers
Selenium navigation
- [Instructor] In order to drive your webpage with Selenium, you need to be able to find elements on your page. Selenium Python offers a lot of ways to do this, so let's go over a few of the common ones as well as look at some of pitfalls of using them. In order to do this, let's work with a real-life site. And what better place to do this than with the Selenium HQ site itself? The first thing we need to do is to figure out what elements are on the page. The easiest way to do that is by using the right-click menu and Inspect to bring up the browser tools. The main thing, when selecting an element, is to find a unique selector for that element. Often, the class or the id of an element is a good place to start. But as you can see with this one, there's no id defined and the class is an icon, of which there are many on this page. So in this particular case, there aren't many unique selectable identifiers. So there are a couple of things that we could do, but let's try this one. We'll…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.