From the course: Robot Framework Test Automation: Level 2
Unlock this course with a free trial
Join today to access over 23,400 courses taught by industry experts.
Custom CSV parsing library - Selenium Tutorial
From the course: Robot Framework Test Automation: Level 2
Custom CSV parsing library
- [Instructor] The next thing we'll do is to create a custom library that can read CSV files. So for this, I'm going to right-click and create a new directory called CustomLibs or CustomLibs for those of you who pronounce it that way. And from there, I'll right-click on this, create a new file and I'm just going to call it Csv.py and we're calling it PY instead of .robot because this is actually a Python script that represents a custom robot framework library. The first thing we type at the top of the file is import, space, CSV and notice how we get to IntelliSense so we know this is a valid thing to do. And you can see where this lives. It's in C:\Python27\Lib which means it's a library that comes as part of Python. So this CSV library is going to do the heavy lifting for us. Hit return, and now just like we did in a previous lecture about creating custom libraries, I'll type in def and the name of my function read_csv_file and if I put a colon on the end, we already have the makings…
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.
Contents
-
-
-
-
-
-
-
-
-
-
-
-
Overview of the steps1m 59s
-
(Locked)
Create the CSV data file2m 45s
-
(Locked)
Custom CSV parsing library4m 15s
-
(Locked)
Create our data manager3m 3s
-
(Locked)
Call the data manager3m 26s
-
(Locked)
Create the looping keyword file3m 58s
-
(Locked)
Refactor data entry steps1m 47s
-
(Locked)
Run and debug5m 2s
-
(Locked)
Add error handling59s
-
-