Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Robot Framework Test Automation
Robot Framework Test Automation

Robot Framework Test Automation: Create test suites and automated acceptance tests from scratch

eBook
$9.99 $19.99
Paperback
$32.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing
Table of content icon View table of contents Preview book icon Preview Book

Robot Framework Test Automation

Chapter 2. Configuring a Test Project

In this chapter, exclusive focus is on the structure and files contained in test. The topic has already been touched upon briefly in the first chapter, but a closer look at them would help set the background for further exploration as tests are the most important feature of the Robot Framework. The following major topics will be covered in this chapter:

  • Creating a Robot Framework test file and a testsuite.

  • Understanding differences in syntax across different file formats used in configuration. Gaining knowledge about the different configuration files.

  • Understanding and utilizing setup and teardown operations

  • Increasing automation through test re-use

We will start by explaining, what a test is and how it can be defined. Different type of tests and common naming conventions along with examples will be explained thereafter. Test file structure and their supported formats will be understood by the end of the chapter.

The Robot Framework makes it very easy to change...

Test naming conventions


Test naming conventions are important for the standardization and coherence of the tests. It also indicative of the quality of tests as the naming and placement of tests; and the use case scenarios indicate their order and relevance, which can be very useful when the tests are maintained in future.

Creating an execution order

In order to name tests, the Robot Framework is very peculiar; it uses the configuration file and folder names to determine the execution order and test naming.

For example, consider the following arrangement of different test files and folders in the test project in the file system:

application/

tests/

Test1.txt

Other tests/

Another test.txt

Running the pybot in the application folder will result in creation of different testsuites in the report based on the order of their presence in the file system. The following screenshot shows the file structure of a Robot Framework test:

After running, the tree command lists out the file/folder...

Test file structure


So far, it has been demonstrated that whitespaces play an important role in configuration files. The test configuration is written in a tabular format with each column having separate elements such as test element. The Robot Framework allows flexibility in specifying the separations among the different columns in a test file as well as supporting different formats for the test files, which you can choose at your discretion. Note that depending upon the file extension; a suitable parser is selected during runtime. Some of the supported formats are as follows:

  • HTML

  • TSV

  • Plaintext

  • Piped text

  • RestructuredText

HTML format

In an HTML format, the HTML is read, which comprises of different tables for different portions of the test configuration. For each table, the first heading element is read and based on this information; the rest of the table is understood. A word of caution! Any data that is outside the recognized table is discarded. You can understand this better with the help...

Test configuration files


As mentioned before, the tests are stored in files and are clubbed in folders that act as test suite for the files. A test file can contain different sections, which can optionally be moved into other files dedicated specifically towards the work of that particular section. Thus reducing the length and complexity of the actual test file, which is helpful if the test size is very large.

The test configuration files apart from the actual test files and folders are:

Suite initialization files

A folder in the Robot Framework denotes a test suite for all the files and subfolders contained in it. As there is no way to specify metadata of the test suite except for the folder name, there is a provision for special files that pertain to the folder in which they are placed. As with specifying a directory as a module in Python, initialization files have to be named as __init__ and their extension can be any valid extensions allowed by the Robot Framework. The format of these files...

Summary


In this chapter, various files involved in the Robot Framework test creation and configuration together with the test naming conventions for different components such as, test suite, test case, and test action were discussed and the execution order management was detailed. As the test file format is quite different from any other test, it was exhaustively discussed as well. The use of variables as well as extra files are also discussed as these promote test code re-use and separate the test contents. Finally, the test environment management through test setup and teardown was discussed, which is essential if the tests require any prior dependency.

This serves as the groundwork for further work over the framework and as the basic syntaxes mentioned here are covered, the test automation and re-use will be discussed in the next chapter that continues from the work that has been covered here in order to automate and re-use existing tests.

Left arrow icon Right arrow icon

Key benefits

  • Create a Robot Framework test file and a test suite
  • Identify and differentiate between different test case writing styles
  • Full of easy- to- follow steps, to get you started with Robot Framework

Description

Testing has traditionally been a part of software development, and has always involved a lot of manual effort. It can be automated with Robot Framework, which offers numerous benefits from cost saving to increased quality assurance in the software delivery. This book will help you to start designing test suites and Automated Acceptance Tests. Helping you to get started with automating acceptance tests, this book will provide a detailed overview of acceptance test management practices and principles. You will also be introduced to advanced techniques that you can use to customize the test suite, along with helpful tips and tricks to extend and leverage it in a wide variety of scenarios. Starting with a detailed explanation of the need for automated acceptance test driven development, this guide will help you with an empty test project creation and execution for proof of concept, and validation of installation. This book will also cover the Robot Framework in detail, and will help you test desktop applications using Java Swing. You will gain an in-depth knowledge of tricky activities, such as setting up a test environment and using it with Selenium. You will also learn about other popular libraries, and how to test network protocols, web services, and databases. This book will cover the entire Robot Framework with real- world practical material to make its content informative and interesting. By the end of this book you will be able to write acceptance tests for desktop and web applications, as well as know how to extend acceptance testing in other scenarios that are commonly devoid of tests, and present the results appropriately.

Who is this book for?

If you are an automation engineer, QA engineer, developer or tester who is looking to get started with Robot Framework, as well as find a standardized testing solution, this book is ideal for you. No prior knowledge of Robot Framework or acceptance testing is required, although a basic knowledge of Python is required for few sections of the book.

What you will learn

  • Create and run a basic test over Robot Framework to validate the setup
  • Customize a test with reusable components and introduce test reuse
  • Identify the different files and tables used in tests
  • Extend the framework by using third party libraries to work with other tools
  • Parameterize the test cases and get data into the tests /color
  • Create derived reports using the report metadata
  • Use external resources to feed data into tests
  • Set up the Robot Framework and run its basic test

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Oct 25, 2013
Length: 98 pages
Edition : 1st
Language : English
ISBN-13 : 9781783283033
Languages :

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

Product Details

Publication date : Oct 25, 2013
Length: 98 pages
Edition : 1st
Language : English
ISBN-13 : 9781783283033
Languages :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total $ 136.97
Robot Framework Test Automation
$32.99
Building Machine Learning Systems with Python
$54.99
Data Visualization with D3.js Cookbook
$48.99
Total $ 136.97 Stars icon
Banner background image

Table of Contents

5 Chapters
Getting Started with the Robot Framework Chevron down icon Chevron up icon
Configuring a Test Project Chevron down icon Chevron up icon
Further Test Customization Chevron down icon Chevron up icon
Extending the Framework Chevron down icon Chevron up icon
Generating Reports Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Half star icon Empty star icon Empty star icon Empty star icon 1.8
(18 Ratings)
5 star 0%
4 star 0%
3 star 22.2%
2 star 33.3%
1 star 44.4%
Filter icon Filter
Top Reviews

Filter reviews by




Ray Robinson Sep 16, 2014
Full star icon Full star icon Full star icon Empty star icon Empty star icon 3
most of what is contained here can be found in the online docs and although it neatly brings everything together. It's not worth the price.
Amazon Verified review Amazon
marino punturieri Dec 18, 2013
Full star icon Full star icon Full star icon Empty star icon Empty star icon 3
This is the first book about Robot Frameworks as per my knowledge.This should be considered a simple and basic recap for any beginner but as some one already noticed it lacks in depth. Some important real life topics like "continuous integration" are left out.I appreciate the effort to put some example for a "real test" like web site automation, but again too few low level mandatory details seem lost.I would recommend it to anyone would like to have a quick and dirty introduction and would not bother to look on several web site to gather all details.Disclaimer: I got a review copy of the book from Packt.
Amazon Verified review Amazon
D. Luu Dec 09, 2013
Full star icon Full star icon Full star icon Empty star icon Empty star icon 3
I think some of the reviewers may have been a bit harsh in their reviews, so I'll be one of the few to provide a balanced assessment. However, do note that I've read most of the book but skimmed over parts of it and have not looked at the accompanying source code that you have to download from the internet. Therefore, the review is not a complete review of the whole content of the book including the source code.This appears to possibly be the first book about Robot Framework (excluding the framework's user & quick start guides), which I think is a positive thing regardless of the quality of the book. As a whole, the book is nicely written for someone not familiar with Robot Framework (RF) and for non-technical people. It provides a good introduction about RF, delves into some of capabilities and benefits of RF, and is a good stepping stone to use & learn more about RF. It is a good bridge or companion to the RF project's existing User Guide and Quick Start guide, which provide more technical detail and information not covered by this book. For more advanced coverage of RF, look elsewhere, hopefully there will be such a book to cover that in the future.Having said that, the book does have its downsides. As pointed out by others, there are some typos in the current/first edition of the book, not a whole lot, but a few here and there as I've seen. Understandable, but sadly that these were missed before publication. The organization of the book is decent, but could be improved, and the chapter titles don't reflect well against the actual topics in the chapters, at least from a technical user for what they expect to see based on the title alone as the content vs title doesn't quite fit descriptively. Only by reading the details of the chapter summary at beginning of chapter or in the Preface do you see what the chapter is really about (compared to its title).I also found the book a bit lacking in some areas in terms of subject matter or content. The section about Data Driven testing and Behavior Driven Development (BDD) testing could have benefited from elaboration with some actual test case examples and/or code implementation (in the book, not as external accompanying source code samples). The BDD information I felt was too brief in coverage. In same area, the book mentions "DSL" without actually defining the abbreviation (DSL = Domain Specific Language), which is bad form in technical writing as we don't expect the user to already know abbreviations. The book also mentions RF generically without mentioning which version of RF is being covered at the time of publication/writing.I may be incorrect in assumption, but the author also might not be active with and well informed of the RF user and developer community. I say this because while the book does mention some common & useful test libraries, there are some omissions whether by choice or ignorance. For example: AutoItLibrary (for desktop UI testing with free AutoIt tool), ranorex-robot-library (for desktop UI testing with Ranorex commercial tool) SimpleSikuli (Java test library alternative version of Sikuli integration that was covered in the book), SSH library. Another thing the author missed was the fact that the Remote Library interface/API of RF provides for much more than what was mentioned in the book, particularly that it can be used to interface RF to other languages, tools, platforms not natively supported by RF (Python/Jython/IronPython) and as such to execute tests in those areas as well. For example: (pure/native) Java (as opposed to through Jython), pure .NET as opposed to via IronPython, Ruby, Perl, PHP, and more. Furthermore, the book mentions that only the Python and Ruby versions of the (generic) remote server are implemented for users to make use of for remote libraries, and for anything else, one would have to create it themselves, though it is not necessarily hard to do so. But in reality, as of this review (and at least about 1-2 years before it), there have been other (generic) remote libaries server implementations already available (Java, .NET/C#, Perl, PHP, Clojure, node.js), so it is truly really easy to use remote libraries and for other platforms. The author should have also put in some references that for more technical information and whatever not covered by the book, the reader can look to the RF user guide and discussion with the RF user/developer community via the online Google Groups, providing the links to them with the references.So given all this, to an (or a more) advanced/technical user, the book is not very helpful, and for what you can get for free with online searching, the RF user/developer community discussion group, and the framework's existing user guide, the price of the book may also seem extravagant. But I think it is a useful book that can be used to help try and convince upper management, non-technical business stakeholders to adopt RF, etc.I'd like to end the review with some positive points at least. Unless one is well familiar with RF, there are some useful things that can be learned or be reminded of from this book. For me, I hadn't noticed that RF offered a randomization feature when executing test cases and test suites. And the coverage of the test configuration/data files like variable files was a helpful reminder to me. Last, I like the fact (at least what is stated in the book) that Packt publishing has a "Packt Open Source Royalty Scheme, by which Packt gives a royalty to each Open Source project about whose software a book is sold". Which would mean RF should get monetary donations from Packt for each copy of this book bought by somone. I wonder what happens in the case of refunds/returns by customers though. Does that get removed from the donation amount or Packt still passes that on to OSS projects for the "initial" sale.Maybe a future edition of the book will be more improved. And/or look forward to seeing an advanced coverage version of the book for RF for more advanced/technical readers.
Amazon Verified review Amazon
Amazon Customer Dec 09, 2013
Full star icon Full star icon Full star icon Empty star icon Empty star icon 3
The book is a quick and easy 100 pages read that can be useful to those who find the user guide a bit to dry.First chapter helps go through the installation steps but fails at giving a clear picture of Robot Framework ecosystem: a diagram shows a “testing tool” component being the one that actually target the SUT while Robot Framework is more on the user end side as a coordinator. This is just one way to use Robot (a way that is later described more in details in section about Robot+Selenium and Robot+Sikuli). But Robot can be used to test directly the SUT through its native libraries or some custom libraries.Second chapter is quite clear about the different file format and the organization of the test portfolio. Third chapter treats the actual creation of test cases with some data about syntax and libraries, but it lacks some examples going from the easiest to more complex cases. Chapter four discuss Robot association with other testing tools (like mentioned before) and finally the last chapter helps generating standard and custom reports.A topic that is not covered is who is the “ideal” Robot Framework user. It is implied in chapter three that “developer and stakeholders” will collaborate in writing the tests. My experience is rather than a tool like Robot Framework is a very good fit for a QA/testers team that is distinct from dev and stakeholders. For such a team it makes sense to have a specific tool/DSL for testing rather than coding the functional/acceptance tests in the langage of the product.Globally though the book is a good read, it fails at being a real “missing manual” compared to what the User Guide already offers. The book would maybe have benefit from taking an alternate approach with much more example, like a cookbook, and more experience from the field. Anyway, thanks to Sumit and Packt for the effort in sharing some knowledge about Robot Framework!
Amazon Verified review Amazon
DJ Nov 22, 2013
Full star icon Full star icon Empty star icon Empty star icon Empty star icon 2
The "In Detail" description of this book is extremely well written, deceivingly so.I would not use words like "in depth" to describe this book.Upon receipt I flipped through the pages briefly, looked at a couple of the examples, and immediately boxed the book for return.There might be a few hints, tips, and tricks, but there's really not much beyond a very basic primer. You could easily read the robot framework documentation online in a couple hours, do a few google searches, and you'll be well beyond what this book has to offer.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is included in a Packt subscription? Chevron down icon Chevron up icon

A subscription provides you with full access to view all Packt and licnesed content online, this includes exclusive access to Early Access titles. Depending on the tier chosen you can also earn credits and discounts to use for owning content

How can I cancel my subscription? Chevron down icon Chevron up icon

To cancel your subscription with us simply go to the account page - found in the top right of the page or at https://subscription.packtpub.com/my-account/subscription - From here you will see the ‘cancel subscription’ button in the grey box with your subscription information in.

What are credits? Chevron down icon Chevron up icon

Credits can be earned from reading 40 section of any title within the payment cycle - a month starting from the day of subscription payment. You also earn a Credit every month if you subscribe to our annual or 18 month plans. Credits can be used to buy books DRM free, the same way that you would pay for a book. Your credits can be found in the subscription homepage - subscription.packtpub.com - clicking on ‘the my’ library dropdown and selecting ‘credits’.

What happens if an Early Access Course is cancelled? Chevron down icon Chevron up icon

Projects are rarely cancelled, but sometimes it's unavoidable. If an Early Access course is cancelled or excessively delayed, you can exchange your purchase for another course. For further details, please contact us here.

Where can I send feedback about an Early Access title? Chevron down icon Chevron up icon

If you have any feedback about the product you're reading, or Early Access in general, then please fill out a contact form here and we'll make sure the feedback gets to the right team. 

Can I download the code files for Early Access titles? Chevron down icon Chevron up icon

We try to ensure that all books in Early Access have code available to use, download, and fork on GitHub. This helps us be more agile in the development of the book, and helps keep the often changing code base of new versions and new technologies as up to date as possible. Unfortunately, however, there will be rare cases when it is not possible for us to have downloadable code samples available until publication.

When we publish the book, the code files will also be available to download from the Packt website.

How accurate is the publication date? Chevron down icon Chevron up icon

The publication date is as accurate as we can be at any point in the project. Unfortunately, delays can happen. Often those delays are out of our control, such as changes to the technology code base or delays in the tech release. We do our best to give you an accurate estimate of the publication date at any given time, and as more chapters are delivered, the more accurate the delivery date will become.

How will I know when new chapters are ready? Chevron down icon Chevron up icon

We'll let you know every time there has been an update to a course that you've bought in Early Access. You'll get an email to let you know there has been a new chapter, or a change to a previous chapter. The new chapters are automatically added to your account, so you can also check back there any time you're ready and download or read them online.

I am a Packt subscriber, do I get Early Access? Chevron down icon Chevron up icon

Yes, all Early Access content is fully available through your subscription. You will need to have a paid for or active trial subscription in order to access all titles.

How is Early Access delivered? Chevron down icon Chevron up icon

Early Access is currently only available as a PDF or through our online reader. As we make changes or add new chapters, the files in your Packt account will be updated so you can download them again or view them online immediately.

How do I buy Early Access content? Chevron down icon Chevron up icon

Early Access is a way of us getting our content to you quicker, but the method of buying the Early Access course is still the same. Just find the course you want to buy, go through the check-out steps, and you’ll get a confirmation email from us with information and a link to the relevant Early Access courses.

What is Early Access? Chevron down icon Chevron up icon

Keeping up to date with the latest technology is difficult; new versions, new frameworks, new techniques. This feature gives you a head-start to our content, as it's being created. With Early Access you'll receive each chapter as it's written, and get regular updates throughout the product's development, as well as the final course as soon as it's ready.We created Early Access as a means of giving you the information you need, as soon as it's available. As we go through the process of developing a course, 99% of it can be ready but we can't publish until that last 1% falls in to place. Early Access helps to unlock the potential of our content early, to help you start your learning when you need it most. You not only get access to every chapter as it's delivered, edited, and updated, but you'll also get the finalized, DRM-free product to download in any format you want when it's published. As a member of Packt, you'll also be eligible for our exclusive offers, including a free course every day, and discounts on new and popular titles.