Installing the Selenium Library in Robot Framework

SeleniumLibrary is a web testing library for Robot Framework. SeleniumLibrary uses the Selenium WebDriver modules internally to control a web browser.

To install the selenium library into the robot framework Navigate to the link SeleniumLibrary. The GitHub page will open, click on the clone/download and then select the download the Zip.

select-download-zip-option

Once you click on Download Zip and select the path to save the selenium master file

save-the-selenium-library-master-folder

Once the file completes it's downloading, go to the file location and extract the file from the Zip format. Open the extracted file, and you can see the selenium setup file.

selenium-setup-file

Open the Python file location and then save the extracted selenium library-master file inside the python 37 folders.

saving-selenium-master-file-inside-the-python37-folder

Now, right-click on the link path and copy the address of the setup file

copy-the-link-address-of-seleniumlibrary-master

Now, open the command prompt and directed to the setup folder and then, pass the command as setup.py install

passing-the-command-as-setup-install

Now you have successfully installed selenium library

finished-installing-selenium

Now open the Ride editor through command prompt and open the project and click on the Library which is present at the right corner.

select-library-from-ride-editor

The library page will open, now add the name of the library as SeleniumLibrary and click on ok.

importing-selenium-library

If the library is installed successfully, it will be displayed on the page as shown below

successfully-imported-selenium-library

If you have not saved the selenium file inside the python folder, you cannot import the selenium library successfully, while importing the selenium library, it will be displayed in red color.

While importing the library, if you made any spelling mistake also, the file will be displayed in red color only.

spelling-mistake-while-importing-library

The Features of Ride Editor

Creating Web-Based Automation Test Case

We have successfully installed Selenium library, by using the selenium library let us create a web-based test case:

The steps to create a web-based test case is as follow :

First, open the Ride editor, and then right-click on the project and select the New Suite

select-new-suite

Create a new test suite as WebAutomation and click on ok

create-new-test-suite-as-web-automation

Right-click on Web Automation and create a new test case as OpenBrowser and click on the Ok button.

creating-new-test-case-as-open-browser

Open the WebAutomation and import the selenium library in that

importing-selenium-library-into-web-automation

We have successfully imported Selenium Library into Web Automation. Open test case and check for the keyword open browser, it will show you the necessary things to create an open browser such as URL and then the Browser.

url-and-browser

If you scroll down, the keyword show you what kind of browsers it will support for

supporting-browser-for-open-source

Now, pass the arguments as www.google.com and the browser like chrome

pass-the-arguments-for-keywords

Select the test case and click on the Run button and then click on the Start, we will get an error while executing the test case.

got-an-error-while-executing-web-automation-test-case

Open the log report and then open the test page, you will find the error message as

Message:
WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home

error-message

Copy the link address and paste in the browser, the chrome driver page will open

chrome-driver-page

Click on the downloads, and there you will get all the versions of chrome, before downloading, first check which version of chrome you are using.

For that right-click on the three dots(:) on the right upper corner of the windows and then select the help and then click on about google chrome

help-about-chrome

Currently, I am using 77.0 version

about-google-chrome

Go back to the chrome driver download page, and it says that if you are using the google 77 version then download the ChromeDriver 77.0.3865.40

Click on the link and download, and the index page will open, select the win32

select-thewin32-in-the-index-page

Once it completes downloading, extract the file from the zip format and then copy and paste it inside the script file of the python37

pasted-chrome-drive-inside-the-script-folder

Go back to the test case and Run the Web Automation test case; it will successfully open the web browser.

successfully-open-the-browser

The Next thing is, we have to close the browser, for that, open the test script and select the keyword as the close browser.

select-the-keyword-as-close-browser

Run the test case again.

log-report-for-open-and-closing-browser

Comment / Suggestion Section
Point our Mistakes and Post Your Suggestions