What is Python selenium?
Tags: python, webdev
Published: 2019-11-08 11:56:56

---
title: What is Python selenium?
tags: python, webdev
cover_image: https://thepracticaldev.s3.amazonaws.com/i/493wunp8tgdwxpg5bs6n.png
published: true
---
So you are researching how to test your brand new web application and you have heard and the seen the term <a href="https://pypi.org/project/selenium/">Python selenium</a> being coined among developers and coders alike.

Firstly, let us cover the question, what exactly is selenium?

<a href="https://www.seleniumhq.org/">Selenium</a> is a popular choice for those interested in *automating the testing carried out on web browsers*. 

It is an open source tool, which means it is free to use, redistribute and even modify, so the software is available for anyone to utilise. 

To be specific: *Selenium is a suite of tools to automate web browsers across many platforms.*

This makes the software more enticing compared to its competitors, which probably accounts for how popular selenium is becoming.

If you want to automate the web browwser with Python, you should <a href="https://pythonbasics.org/">learn the Python basics</a> first.

## What can Selenium test?

Unfortunately selenium cannot be used to test any desktop or mobile applications, only those created *solely for the web*. 

To test for these applications you will need to use alternative software like QPT created by HP, or RFT created by IBM etc.

<img src="https://thepracticaldev.s3.amazonaws.com/i/zzin4zqqbeipykjxs4e4.png">

## Why was selenium invented?

With the invention of the microchip and software that has developed in its wake, came the need to develop software testing abilities. 

Developers had to ensure that the code they released into products and systems was safe, reliable and without error. This in turn, encouraged the need for testing.

### Testing

Manual testing however was a slow, time consuming and even quite tedious method of testing, it was also not cost effective, as you needed more developers available. 

Automatic testing cancels out the possibility of human error (as long as the original code was accurately executed), so selenium was then created to improve upon manual testing.

<img src="https://www.seleniumhq.org/selenium-ide/img/home/bullseye.png">

So, we understand what selenium is, read on to discover how to begin using python selenium and why it is a popular choice for many developers.

## Where can I use selenium?

Selenium is a free to use software, it can be downloaded and installed online. 

It can be used with a variety of different programming languages, those being Java, C#, PHP, Ruby, .Net, Perl and of course <a href="https://pythonbasics.org/selenium_browsers/">Python</a>. 

<img src="https://www.seleniumhq.org/selenium-ide/img/home/computer.png">

The testing of your web application can be carried out on any of the major computer operating systems, including Mac, Windows and of course Linux. It can also be tested on all the major web browsers like 

* Safari
* Mozilla Firefox
* PhantomJS (a headless browser)
* Google Chrome
* Internet Explorer
* Opera.

Selenium can also be integrated with other tools, for example <a href="https://junit.org/junit4/">JUnit</a>, <a href="https://maven.apache.org/">Maven</a>, <a href="https://www.docker.com/">Docker</a>, <a href="https://jenkins.io/">Jenkins</a> and <a href="https://testng.org/doc/">TestNG</a>, this provides lots of benefits like report generation and even continuous testing.

Selenium includes other tools like <a href="https://www.seleniumhq.org/selenium-ide/">Selenium IDE</a>, Grid and <a href="https://www.seleniumhq.org/projects/webdriver/">WebDriver</a>, each possess its own benefits when testing your web application. For example selenium grid offers a reduced execution time and scalability. 

`Selenium web driver is the software that allows cross browser testing and also allows you to use a programming language like python.`

## Conclusion

Compared to other automatic testing software available for web browsers, selenium has an array of appealing factors that make it stand out from its competitors. 

Being open source is just one of the huge benefits, as for small companies it can save a large portion of their project budget as there is no need for additional licensing costs.

**Related links:**
* <a href="https://www.seleniumhq.org/projects/webdriver/">Selenium Webdriver</a>
* <a href="https://pythonbasics.org/selenium_find_element/">Short Selenium tutorial</a>
* <a href="https://pythonbasics.org/">Learn Python basics</a>