From the course: Robot Framework Test Automation: Level 2
Unlock this course with a free trial
Join today to access over 22,600 courses taught by industry experts.
Dictionary overview - Selenium Tutorial
From the course: Robot Framework Test Automation: Level 2
Dictionary overview
- [Instructor] In the level one course, we talked about two different kinds of variables, scalar and list. As you recall, scalar allowed us to hold one value in our variable, and the list variable allowed us to hold multiple values. When you're automating tests, it's going to be valuable for you to be able to describe and hold input data that's relatively complex, and we also want to be able to interact with that data in a meaningful way within the script. So that's where dictionaries come along, and they are a type of variable. They are similar to a list, in that they hold many items, but instead of accessing the items via a numerical index, we can use meaningful names. And the uses for a dictionary could be things like all the different URLs for a site under test, like you could create a dictionary that holds the dev URL, the QA URL, the stage URL, and the prod URL, all in one variable. You could also hold attributes of a user, for instance. You could describe this user entity with…
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.