|
|
|
# Robot Framework
|
|
|
|
|
|
|
|
Robot Framework is a generic open source automation framework for acceptance testing, acceptance test driven development (ATDD), and robotic process automation (RPA)
|
|
|
|
|
|
|
|
## Installation
|
|
|
|
|
|
|
|
```bash
|
|
|
|
sudo apt-get install python3-pip &&
|
|
|
|
pip3 install robotframework robot framework-seleniumlibrary
|
|
|
|
```
|
|
|
|
|
|
|
|
Get the latest driver for your browser. This example shows how to do it for Chrome and Firefox. Use command wget <the link to the driver> to download the driver.
|
|
|
|
|
|
|
|
```
|
|
|
|
wget https://github.com/mozilla/geckodriver/releases/download/v0.24.0/geckodriver-v0.24.0-linux64.tar.gz
|
|
|
|
wget https://chromedriver.storage.googleapis.com/2.29/chromedriver_linux64.zip
|
|
|
|
```
|
|
|
|
|
|
|
|
Check/Get the latest versions from the websites below:
|
|
|
|
[Mozilla](https://github.com/mozilla/geckodriver/releases)
|
|
|
|
[Chrome](https://sites.google.com/a/chromium.org/chromedriver/downloads)
|
|
|
|
|
|
|
|
The drivers are compressed, so we need to extract them
|
|
|
|
|
|
|
|
```
|
|
|
|
tar xzfv geckodriver-v0.24.0-linux64.tar.gz
|
|
|
|
unzip chromedriver_linux64.zip
|
|
|
|
```
|
|
|
|
|
|
|
|
By default, Robot Framework does not have the permission to execute the driver, so we add execution permissions for everyone:
|
|
|
|
|
|
|
|
```
|
|
|
|
sudo chmod +x geckodriver
|
|
|
|
sudo chmod +x chromedriver
|
|
|
|
```
|
|
|
|
|
|
|
|
Finally, move the drivers to the `bin` folder, where Robot Framework executes them.
|
|
|
|
|
|
|
|
```
|
|
|
|
sudo mv geckodriver /usr/local/bin
|
|
|
|
sudo mv chromedriver /usr/local/bin
|
|
|
|
```
|
|
|
|
|
|
|
|
To test that the installation was successful:
|
|
|
|
|
|
|
|
CTRL+ALT+T to open a new terminal
|
|
|
|
|
|
|
|
```
|
|
|
|
mkdir robot-tests && cd robot-tests
|
|
|
|
curl https://pastebin.com/raw/hQr4zavE > test.robot &&
|
|
|
|
robot test.robot
|
|
|
|
```
|
|
|
|
|
|
|
|
Download Visual Studio Code or another text editor or IDE. Visual Studio Code can be found in Ubuntu Software Center.
|
|
|
|
|
|
|
|
Additionally if you want to make things easier download Robot Framework Intellisense in Visual Studio Code. You can find it in the extensions section. |