Skip to content

Instantly share code, notes, and snippets.

View pragmatictesters's full-sized avatar
😀
Learn | Train | Transform | Earn

Janesh Kodikara pragmatictesters

😀
Learn | Train | Transform | Earn
View GitHub Profile
@pragmatictesters
pragmatictesters / remove-ramping-test-results.groovy
Created August 24, 2021 11:51
Remove the rampup and rampdown test results from test result file
File file = new File("runLoadTest.jtl")
def line, noOfLines=0;
def starTime
def addedLines=0
file.withReader {it->
line= it.readLine()
line= it.readLine()
starTime = line.split(",").first().toLong()
@pragmatictesters
pragmatictesters / run-multiple-tests.sh
Created August 15, 2021 05:23
Running multiple JMeter tests in a directory and genreating HTML report at the end
JMETER_HOME=../install/apache-jmeter-5.4.1
TEST_PLAN_HOME=/Users/hansi/Documents/learning/Xap.PerformanceTesting/test_plans/xap/sanity/
TEST_RESULT_HOME=/Users/hansi/Documents/learning/Xap.PerformanceTesting/test_results/sanity/
TEST_REPORTS_HOME=/Users/hansi/Documents/learning/Xap.PerformanceTesting/test_reports/sanity/
TEST_RESULT_FILENAME="test-results-xap-sanity-test"
printf "Starting the sanity test\n"
while :; do
@pragmatictesters
pragmatictesters / BrowserManager.java
Last active July 14, 2022 08:38
Selenium WebDriver : Abstracting browser management
package com.pragmatic.cucumber;
import io.github.bonigarcia.wdm.WebDriverManager;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
import org.openqa.selenium.edge.EdgeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxOptions;
import org.openqa.selenium.ie.InternetExplorerDriver;
package com.pragmatic.sevenstar;
import io.github.bonigarcia.wdm.WebDriverManager;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.Assert;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeClass;
@pragmatictesters
pragmatictesters / BrowserManager.java
Last active July 14, 2022 08:22
Selenium Browser Manager
package com.pragmatic.cucumber;
import io.github.bonigarcia.wdm.WebDriverManager;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
import org.openqa.selenium.edge.EdgeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxOptions;
import org.openqa.selenium.ie.InternetExplorerDriver;
@pragmatictesters
pragmatictesters / pom.xml
Created December 8, 2020 05:54
Pragmatic Learning Dec 2020
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.example</groupId>
<artifactId>ptl-hrm</artifactId>
<version>1.0-SNAPSHOT</version>
@pragmatictesters
pragmatictesters / pom.xml
Created March 7, 2020 16:31
Selenium WebDriver ReportNG integration. Sample testng.xml and pom.xml files
<?xml version="1.0" encoding="UTF-8"?>
<!-- ................................................................. -->
<!-- SAMPLE pom.xml file with Selenium + TestNG + ReportNG integration -->
<!-- ................................................................. -->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.example</groupId>
@pragmatictesters
pragmatictesters / pom.xml
Last active September 14, 2022 04:47
Maven project file, POM.XML for Selenium-Cucumber integration project
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.pragmatic</groupId>
<artifactId>SeleniumSweden</artifactId>
<version>1.0-SNAPSHOT</version>
@pragmatictesters
pragmatictesters / LoginPage.cs
Last active March 23, 2019 17:25
Selenium WebDriver C# : Login Page
using OpenQA.Selenium;
using OpenQA.Selenium.Support.PageObjects;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ISMDemoApplication
{
@pragmatictesters
pragmatictesters / LoginTest.cs
Created March 23, 2019 17:20
Selenium WebDriver C# : Sample Tests
using Microsoft.VisualStudio.TestTools.UnitTesting;
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Interactions;
using OpenQA.Selenium.Support.UI;
using System;
using System.Collections.Generic;
namespace ISMDemoApplication