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.
Return values from keywords - Selenium Tutorial
From the course: Robot Framework Test Automation: Level 2
Return values from keywords
- [Bryan] In the level one course, when we were testing things, we pretty much, were passing information into keywords, and then relying on some kind of assertion to know whether the test case passed or failed. There are times when you'd like for your scripts to be a little more sophisticated than that. And, what that means is, a given keyword can call another keyword to do some work, and then have that keyword pass information back to the original keyword that made the call, and that top-level keyword can make a decision about whether that was a good or bad thing, and then make an assertion from there. So, the way we can return values from keywords, is simply to declare a local variable, and assign it's value to a keyword which contains a return statement. Then, in that keyword, add another line with square brackets, and the word return, and then pass back anything you'd like to return. And, that could be a string, or an integer, or even multiple values if the variable you're…
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
-
-
-
Getting help from other Robot Framework users5m 32s
-
(Locked)
PyCharm Find Usages feature1m 14s
-
(Locked)
PyCharm TODO feature2m 56s
-
(Locked)
Advanced command-line options5m 11s
-
(Locked)
Force test execution order2m 29s
-
(Locked)
Randomize test execution order2m 50s
-
(Locked)
Get more detailed logs5m 25s
-
(Locked)
Automatic variables1m 56s
-
(Locked)
Return values from keywords2m 53s
-
(Locked)
Create custom keyword libraries4m 50s
-
-
-
-
-
-
-
-
-
-
-