“Robot Framework is a generic open source automation framework. It can be used for test automation and robotic process automation (RPA).” robotframework.org
Setting up a Robot framework environment with Selenium library to run on VS code in Windows environment:
- Download and Install required softwares :
- Find the latest version of Python on : https://www.python.org/downloads/
- While installing, do not forget to click on Add Python to Windows PATH check box. If you missed that here how to add it manualy:
- Either navigate to the Windows Environment Variables screen from your windows (where you can add/edit your paths) or press the Windows Key + R on your keyboard in order to open the Run dialog box Type sysdm.cpl to open the System Properties Go to the Advanced tab and then click on the “Environment Variables”
- Click on ‘New…‘ to add the ‘Path’ variable (note : if your “Path” variable already exists, then click on “Edit” instead):
- Before you type any values, you’ll need to locate the relevant Python paths. The paths that you’ll need to get are:
- The Python application path, which is the folder where you originally installed Python.
- The Python Scripts path. The Scripts folder should be located within the Python application path.
- For the Variable name, type “Path”. For the Variable value, copy the full Python application path, then use semicolon, and finally copy the Python Scripts path. Two pathways above one after another seperated by a “;”.
- Press “OK” and you would then see your new Python Path under the “User variables” section. Don’t forget to press “OK” again so that the changes will get implemented.
- Robot Framework
- Open CMD command line on Windows and type “pip install robotframework” then you can check if installation was successful by typing in comand line “robot –version”
- Robot Framework Selenium Library
- The recommended installation method is using pip again from a CMD command linehttps://code.visualstudio.com/download: “pip install –upgrade robotframework-seleniumlibrary” Running this command installs also the latest Selenium and Robot Framework versions, but you still need to install browser drivers separately.
- VS code : download and install “Visual Studio Code” from its graphical installation file. link is given below.
- VS code Robot Framework Intellisense extention : in the “VS code Extensions” menu search for “Robot Framework Intellisense” and install the plugin.
- WebDriver placement : Download the corresponding web drivers depends on which web browser you are going to work with, and place it in the project folder.
- Create a new robot file : Start a simple open browser robot file and look at the robot framework documentary for keywords on selenium. Discover.
How a Robot framework codes look like :