In this blog,
we are going to learn, what is SonarQube, how to integrate our selenium automation script or any other code with SonarQube for automatic Code Quality analysis and identify the different vulnerabilities.
What is SonarQube??
SonarQube
is an open-source platform for continuous inspection of code quality to
perform automatic reviews with static analysis of code to detect bugs, code smells,
and security vulnerabilities. It also offers various reports on code coverage,
complexity, coding practices as well as on duplicate code. SonarQube Supports
20+ Programming languages.
Please
Note before starting further on this blog, I am assuming you have basic
knowledge about maven, and it is already installed in the local machine as well as
in your ide along with all other maven plugins to execute the test.
How to install SonarQube??
We Can download SonarQube from the official
website of Sonar under the download section or directly using the below links.
To Start SonarQube
In SonarQube
installation folder under the bin, depending on your OS version there would be file name StartSonar.bat click on that file.
In the command
prompt we will be getting a message stating that “SonarQube is up”.
By default SonarQube
runs on http://localhost:9000
Default
username and password of SonarQube is admin.
Sometime it may also ask the user to generate token this is a completely optional step and could be
skip.
Now let’s check out how we can integrate Selenium
or any other project with SonarQube.
1)
Inside
project POM.xml file add the below two plugins i.e maven Sonar Scanner and jacoco
Plugin.
mvn clean install sonar:sonar
To know how we can read the SonarQube Report, please
Click on this link.
Please refer this blog on
how to integrate SonarQube with Jenkins.
Keep Learning, Keep Sharing.
Can elaborate a bit more about step-2
ReplyCan you elaborate a bit more about step-2
ReplyThanks for sharing steps to integrate SonarQube with Selenium. We followed the steps and we successfully got the report but our report is showing Coverage as 0.0%. Any idea what has been missed.
ReplyFake Bank Statement
ReplyFake Bank Statement
Fake Bank Statement
Fake Bank Statement
Fake Bank Statement
Fake Bank Statement
Fake Bank Statement
Fake Bank Statement