Download Grafana from this link
https://grafana.com/grafana/download?platform=windows
Dowload zip file (Standalone file)
Unzip it
Go to CMD
Go to bin folder
cd C:\Users\NEERAJ\Downloads\grafana-6.3.5\bin
type
grafana-server.exe
Grafana will start
Go to below URL
http://localhost:3000/login
By default username and password is "admin"
Download Influx DB
https://portal.influxdata.com/downloads/
https://dl.influxdata.com/influxdb/releases/influxdb-1.7.8_windows_amd64.zip
Extract zip folder
Click on influxd.exe
Also
Click on influx.exe
Now you should see below
Connected to http://localhost:8086 version 1.7.8
InfluxDB shell version: 1.7.8
We will create Database now
> CREATE DATABASE selenium
> use selenium
Using database selenium
In project Pom.xml, add below Dependency
<dependency>
<groupId>org.influxdb</groupId>
<artifactId>influxdb-java</artifactId>
<version>2.12</version>
</dependency>
We will write ExecutionListener
package com.selenium.grid;
import java.util.concurrent.TimeUnit;
import org.influxdb.dto.Point;
import org.testng.ITestContext;
import org.testng.ITestListener;
import org.testng.ITestResult;
public class ExecutionListener implements ITestListener {
public void onTestStart(ITestResult iTestResult) {
}
public void onTestSuccess(ITestResult iTestResult) {
this.sendTestMethodStatus(iTestResult, "PASS");
}
public void onTestFailure(ITestResult iTestResult) {
this.sendTestMethodStatus(iTestResult, "FAIL");
}
public void onTestSkipped(ITestResult iTestResult) {
this.sendTestMethodStatus(iTestResult, "SKIPPED");
}
public void onTestFailedButWithinSuccessPercentage(ITestResult iTestResult) {
}
public void onStart(ITestContext iTestContext) {
}
public void onFinish(ITestContext iTestContext) {
this.sendTestClassStatus(iTestContext);
}
private void sendTestMethodStatus(ITestResult iTestResult, String status) {
Point point = Point.measurement("testmethod")
.time(System.currentTimeMillis(), TimeUnit.MILLISECONDS)
.tag("testclass", iTestResult.getTestClass().getName())
.tag("name", iTestResult.getName())
.tag("description", iTestResult.getMethod().getDescription()) // hence we will have to //write test cases with description
.tag("result", status)
.addField("duration", (iTestResult.getEndMillis() - iTestResult.getStartMillis()))
.build();
ResultSender.send(point);
}
private void sendTestClassStatus(ITestContext iTestContext) {
Point point = Point.measurement("testclass")
.time(System.currentTimeMillis(), TimeUnit.MILLISECONDS)
.tag("name", iTestContext.getAllTestMethods()[0].getTestClass().getName())
.addField("duration", (iTestContext.getEndDate().getTime() - iTestContext.getStartDate().getTime()))
.build();
ResultSender.send(point);
}
}
Important
Make sure that you write test cases with description, as you can see in ExecutionListener we are setting the description, so we need description of test cases
Example
@Test(description = "login")
Write Result Sender Class
package com.selenium.grid;
import org.influxdb.InfluxDB;
import org.influxdb.InfluxDBFactory;
import org.influxdb.dto.Point;
public class ResultSender {
private static final InfluxDB INFLXUDB = InfluxDBFactory.connect("http://localhost:8086", "root", "root");
private static final String DATABASE = "selenium";
static{
INFLXUDB.setDatabase(DATABASE);
}
public static void send(final Point point){
INFLXUDB.write(point);
}
}
Next Step
Write test cases
with Listener
@Listeners(ExecutionListener.class)
public class GridExampleTest1 {
@Test(description = "login")
Data Source for Dashboard
Execute Test case and you will see the Dashboard showing you execution graph
Explore is the area where you can run query, just in case if you want to see the data
https://grafana.com/grafana/download?platform=windows
Dowload zip file (Standalone file)
Unzip it
Go to CMD
Go to bin folder
cd C:\Users\NEERAJ\Downloads\grafana-6.3.5\bin
type
grafana-server.exe
Grafana will start
Go to below URL
http://localhost:3000/login
By default username and password is "admin"
Download Influx DB
https://portal.influxdata.com/downloads/
https://dl.influxdata.com/influxdb/releases/influxdb-1.7.8_windows_amd64.zip
Extract zip folder
Click on influxd.exe
Also
Click on influx.exe
Now you should see below
Connected to http://localhost:8086 version 1.7.8
InfluxDB shell version: 1.7.8
We will create Database now
> CREATE DATABASE selenium
> use selenium
Using database selenium
In project Pom.xml, add below Dependency
<dependency>
<groupId>org.influxdb</groupId>
<artifactId>influxdb-java</artifactId>
<version>2.12</version>
</dependency>
We will write ExecutionListener
package com.selenium.grid;
import java.util.concurrent.TimeUnit;
import org.influxdb.dto.Point;
import org.testng.ITestContext;
import org.testng.ITestListener;
import org.testng.ITestResult;
public class ExecutionListener implements ITestListener {
public void onTestStart(ITestResult iTestResult) {
}
public void onTestSuccess(ITestResult iTestResult) {
this.sendTestMethodStatus(iTestResult, "PASS");
}
public void onTestFailure(ITestResult iTestResult) {
this.sendTestMethodStatus(iTestResult, "FAIL");
}
public void onTestSkipped(ITestResult iTestResult) {
this.sendTestMethodStatus(iTestResult, "SKIPPED");
}
public void onTestFailedButWithinSuccessPercentage(ITestResult iTestResult) {
}
public void onStart(ITestContext iTestContext) {
}
public void onFinish(ITestContext iTestContext) {
this.sendTestClassStatus(iTestContext);
}
private void sendTestMethodStatus(ITestResult iTestResult, String status) {
Point point = Point.measurement("testmethod")
.time(System.currentTimeMillis(), TimeUnit.MILLISECONDS)
.tag("testclass", iTestResult.getTestClass().getName())
.tag("name", iTestResult.getName())
.tag("description", iTestResult.getMethod().getDescription()) // hence we will have to //write test cases with description
.tag("result", status)
.addField("duration", (iTestResult.getEndMillis() - iTestResult.getStartMillis()))
.build();
ResultSender.send(point);
}
private void sendTestClassStatus(ITestContext iTestContext) {
Point point = Point.measurement("testclass")
.time(System.currentTimeMillis(), TimeUnit.MILLISECONDS)
.tag("name", iTestContext.getAllTestMethods()[0].getTestClass().getName())
.addField("duration", (iTestContext.getEndDate().getTime() - iTestContext.getStartDate().getTime()))
.build();
ResultSender.send(point);
}
}
Important
Make sure that you write test cases with description, as you can see in ExecutionListener we are setting the description, so we need description of test cases
Example
@Test(description = "login")
Write Result Sender Class
package com.selenium.grid;
import org.influxdb.InfluxDB;
import org.influxdb.InfluxDBFactory;
import org.influxdb.dto.Point;
public class ResultSender {
private static final InfluxDB INFLXUDB = InfluxDBFactory.connect("http://localhost:8086", "root", "root");
private static final String DATABASE = "selenium";
static{
INFLXUDB.setDatabase(DATABASE);
}
public static void send(final Point point){
INFLXUDB.write(point);
}
}
Next Step
Write test cases
with Listener
@Listeners(ExecutionListener.class)
public class GridExampleTest1 {
@Test(description = "login")
Data Source for Dashboard
Execute Test case and you will see the Dashboard showing you execution graph
Explore is the area where you can run query, just in case if you want to see the data
https://bayanlarsitesi.com/
ReplyDeleteTokat
Kastamonu
TekirdaÄŸ
Gümüşhane
MG82
06163
ReplyDeleteÜnye Yol Yardım
Sinop Lojistik
Çerkezköy Petek Temizleme
Bitmex Güvenilir mi
Hakkari Şehirler Arası Nakliyat
Adıyaman Parça Eşya Taşıma
Çerkezköy Oto Boya
Tunceli Parça Eşya Taşıma
Kocaeli Parça Eşya Taşıma
C8679
ReplyDeleteBtcst Coin Hangi Borsada
MuÅŸ Evden Eve Nakliyat
Giresun Parça Eşya Taşıma
Karaman Evden Eve Nakliyat
Kilis Şehir İçi Nakliyat
Ünye Çekici
Elazığ Evden Eve Nakliyat
Burdur Parça Eşya Taşıma
Keçiören Parke Ustası
0ADAA
ReplyDeletebinance referans kodu
9F5B6
ReplyDelete%20 binance referans kodu
56BAC
ReplyDeleteNWC Coin Hangi Borsada
Binance Borsası Güvenilir mi
Soundcloud Dinlenme Satın Al
Madencilik Nedir
Parasız Görüntülü Sohbet
Bitcoin Nasıl Alınır
Binance Ne Zaman Kuruldu
Telegram Görüntüleme Satın Al
Kripto Para Ãœretme Siteleri
49A39
ReplyDeleteFacebook Beğeni Satın Al
Yeni Çıkacak Coin Nasıl Alınır
Threads Takipçi Satın Al
Bitcoin MadenciliÄŸi Siteleri
Pepecoin Coin Hangi Borsada
Likee App BeÄŸeni Hilesi
Bitcoin Ãœretme Siteleri
Bitcoin Yatırımı Nasıl Yapılır
Linkedin BeÄŸeni Hilesi
80674
ReplyDeleteFındıklı
Ä°mamoÄŸlu
SamandaÄŸ
Kofçaz
Bahçelievler
Çameli
Çiğli
Åžahinbey
Kadıköy
CFGJNHGYJN
ReplyDeleteشركة تركيب جبس بورد بجازان
شركة تسليك مجاري Ck8kdCs2O0
ReplyDelete