Skip to content

Instantly share code, notes, and snippets.

@pbandreddy
pbandreddy / JMeter-oauth2.groovy
Created August 2, 2023 06:41
Capture the oatuth 2 Access_token from jmeter using webdriver
import org.openqa.selenium.By
import org.openqa.selenium.JavascriptExecutor
import org.openqa.selenium.support.ui.FluentWait
import org.openqa.selenium.support.ui.Wait
import org.openqa.selenium.WebDriver
import org.openqa.selenium.WebElement
import org.openqa.selenium.support.ui.ExpectedConditions as EC
import java.time.Duration
try {
import groovy.json.JsonSlurper
// Get the extracted "users_id" from the variable
def expectedUserId = vars.get("userId").toInteger()
// Parse the JSON response
def response = SampleResult.getResponseDataAsString()
def json = new JsonSlurper().parseText(response)
// Get the actual "users_id" value from the JSON
<!DOCTYPE html>
<html>
<head>
<title>Upload a HAR file and convert it to CSV</title>
<style>
input[type="file"], input[type="submit"], input[type="text"] {
padding: 10px;
border: none;
border-radius: 5px;
font-size: 16px;
from flask import Flask, render_template, request, send_file
import haralyzer
import csv
import io
import json
app = Flask(__name__)
app.config['MAX_CONTENT_LENGTH'] = 160 * 1024 * 1024 # 160 MB max file size
@app.route('/')
import java.io.File;
import java.nio.file.Files;
import java.nio.file.StandardCopyOption;
import java.time.Instant;
// Set the directory path where the file is located
String directoryPath = "C:/pt-scripts/Scripts/MicroServices/FileService/";
// Set the original file name
String originalFileName = "image.jpeg";
@pbandreddy
pbandreddy / bash-cheatsheet.sh
Created September 21, 2022 06:07
Bash CheatSheet for UNIX System
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
#!/bin/bash
export JMETER_VERSION="3.1"
# Install wger & JRE
apt-get clean && \
apt-get update && \
apt-get -qy install \
wget \
default-jre-headless \
#!/bin/bash
export JMETER_VERSION="3.1"
# Install wger & JRE
apt-get clean && \
apt-get update && \
apt-get -qy install \
wget \
default-jre-headless \