Use the HTML ID attribute to locate elements in Selenium.
- [Instructor] The very first step in test automation is to…locate HTML elements.…Let's take a look at locating elements using the id…attribute along with a code example for the same.…The HTML id attribute specifies a unique id…for an HTML element.…The rules for the id attribute are:…it must contain at least one character,…it must not contain any space characters,…the id value is case sensitive,…and it must be unique in a document.…
We use this method to locate elements when the id attribute…of an element is known.…The first element with a matching attribute…value will be returned.…Let's go ahead and try a hands-on on how to locate…the elements using the id attribute.…I'm going to head over to the exercise files where…under chapter two I have an HTML code file that we will…be using for the whole of chapter two to run our code.…
So I'm going to open this script with sublime text.…As you can see, we have a form element with id loginform.…We'll be writing a python script to…locate this form element.…I'm going to head over to the exercise files again…
- What is automated testing?
- Python-Selenium bindings
- Parsing the DOM structure
- Locating elements in the DOM
- Navigating and interacting with pages
- Explicit and implicit waits
Skill Level Intermediate
Learning Python GUI Programmingwith Burkhard Meier6h 6m Intermediate
Learning Python Web Penetration Testingwith Christian Martorella2h 49m Intermediate
1. What Is Automation Testing and Python-Selenium Framework?
2. Parsing the HTML DOM Structure
3. Navigating through Pages
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.