Selenium is a software-testing framework for web-applications. It also provides a test domain-specific language (Selenese) to write tests in a number of popular programming languages, including C#, Groovy, Java, Perl, PHP, Python, Ruby and Scala. The tests can then run against most modern web browsers. Selenium deploys on Windows, Linux, and OS X platforms.
It is a suite of software tools to automate web browsers. It is an open source and mainly used for functional testing and regression testing. It checks the functional(necessary) requirements of the web page.
Here, I am going to test the project “Certificate Generation System”. You can clone it from https://github.com/amisha2016/Certificates
For it, first install pip3 package.
pip3 install selenium
The webdriver for Firefox is installed along with Selenium but if you want to test your applications on chrome then you need to download the chrome driver and ensure chrome is installed on your Linux distro.
from selenium import webdriver
driver = webdriver.Chrome(“/home/amisha/Downloads/chromedriver”)
assert “Academic Certificate” in driver.title
innn.send_keys(“Selenium web test edit”)
asss.send_keys(“Selenium web test edit”)
assert “Institute Details Saved Succesfully!” in driver.h2
It is the python script which is used to test the page in the project. Similarly for your web-based project there would be a relevant script.
An assertion is a sanity(normal)-check that you can turn on or turn off when you are done with your testing of the program. If the result comes up false, an exception is raised.
Now, give the executable permissions to the python script
sudo chmod 755 sel.py
Correspondingly, you can do it for your own project.