|BIO| |BLOG POSTS - BY DATE| |BLOG POSTS - BY TOPIC| |CONTACT| |WELCOME|




Python, virtual environments and Robot Framework - Preface


01 Feb 2021


[ Python virtualenvironments virtualenv testautomation testframeworks robotframework ]


Python and test automation.

By all appearances, the Python programming language has seen a meteoric rise in popularity over the last couple of years.

When looking at indicators such as the number of:

then the Python language is often (one of) the fastest growing and/or is even in (or close to) pole position.

For instance, Github's 'State of the OCTOVERSE 2020' sports this graphic:

High-level folder structure created by virtualenv.

In another example, JetBrains' ‘State of the developer ecosystem 2020’ notes in its key takeaways that, although Java is the most popular language and JavaScript is the most used language, Python has overtaken Java in the latter category and is also in the top three languages that developers intent to adopt or migrate to. On top of that, it is also the most studied language.

See for similar reports: here, here, here, here, here and here.

Python’s massive gain in popularity appears to be caused in no small part by its exceptional fitness for certain types of jobs.

Python is by many considered to be highly suitable for emerging and trending software engineering fields, such as AI in general and machine learning, data science/analysis and natural language processing in particular. All of these are very hot topics. Consequently, relevant skills are in high demand. And so is Python.

Another trend (or field) that has emerged over the last 10 years or so (although it is much older than that) is test automation. And there too, Python seems to be exceptionally well equipped for the tasks at hand, whether it be unit(-integration) testing, system integration testing or E2E testing. What makes Python such a perfect match are features such as:

Because of these (and other) features Python excels when it comes to providing a combination of learnability, efficiency, flexibility and versatility. That combination makes it just great for test automation.

Consequently, more and more test automation engineers and software development organizations are discovering and turning to Python as the test automation language of their choice.

Then what is this series of posts about?

The series of posts that you are reading now will be the first of many similar collections. Each series will focus on a unique Python feature that can take our test automation projects to a next level. All of them will have extensive hands-on examples.

In this first series of ten posts we will look into virtual Python environments: what are they, what can they do for us, how do they actually work and how to operate them? To accomplish that, we will tackle the following topics:

  1. Preface.
  2. Introduction to virtual environments.
  3. Installation of the required software.
  4. Creating virtual environments.
  5. Creating environment/project ecosystems.
  6. Run Robot tests in a virtual environment.
  7. Manage virtual environments.
  8. Share virtual environments.
  9. Restore virtual environments.
  10. PyCharm and virtual environments.

For the hands-on examples within this series we will be using Robot Framework.

The latter is sort of a bonus by the way, since (at the moment of writing) there isn’t much information to be found on the web, on running the Robot Framework in a virtual environment. There are some articles on the topic, but they are all rather sketchy. I will provide you with a more thorough rundown.

Please note that we will take a dive into the inner workings of virtual environments. I know that quite a few people oppose to long posts that deep-dive into their topics. They just want a concise list of steps without any background as to what happens ‘under the hood’ with each step.

However, I firmly believe that knowing the internals of our tool stacks makes us more efficient and effective as test (automation) engineers.

So, if you are game, you can start reading the second article.

Comments


Please join the discussion: place a comment on this page.

The comment will be immediately visible in this comment section.

Please note a Github account is required to comment.