Skip to content

Instantly share code, notes, and snippets.

View jrizio's full-sized avatar

Jason Rizio jrizio

  • Melbourne, Australia
View GitHub Profile
@jrizio
jrizio / SeleniumTest.java
Last active August 29, 2022 01:57
Updated Selenium example script for Flood.io
import java.net.URL;
import java.util.concurrent.TimeUnit;
import org.junit.Assert;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.WebDriverException;
@jrizio
jrizio / spike_test.ts
Created November 12, 2018 23:06
A Flood Element test to simulate a spike test for an online flash sale event
import { step, TestSettings, TestData, Until, By, Browser, MouseButtons, Device } from '@flood/element'
import * as assert from 'assert'
export const settings: TestSettings = {
clearCache: true,
disableCache: true,
clearCookies: true,
loopCount: -1,
duration: -1,
actionDelay: 2.5,
@jrizio
jrizio / SeleniumExample.java
Created December 4, 2017 05:35
The Selenium Example used in the Flood.io Step-by-step guide for Selenium
import java.net.URL;
import java.util.concurrent.TimeUnit;
import java.util.List;
import java.util.Random;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.WebDriverException;
@jrizio
jrizio / GatlingExample.scala
Last active December 5, 2023 11:03
An example Gatling script using the Flood.io platform
//********************************************************************
//* CHANGELOG
//*
//* 03/05/2019 - Jason Rizio - Updated example for Gatling 3.0
//********************************************************************
import io.gatling.core.Predef._
import io.gatling.http.Predef._
<?xml version="1.0" encoding="UTF-8"?>
<jmeterTestPlan version="1.2" properties="3.2" jmeter="3.3 r1808647">
<hashTree>
<TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Test Plan" enabled="true">
<stringProp name="TestPlan.comments"></stringProp>
<boolProp name="TestPlan.functional_mode">false</boolProp>
<boolProp name="TestPlan.serialize_threadgroups">false</boolProp>
<elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
<collectionProp name="Arguments.arguments"/>
</elementProp>
@jrizio
jrizio / SeleniumTest.java
Last active October 31, 2017 07:29
Example Selenium WebDriver scenario that contains all essential Flood.io code snippets
import java.net.URL;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.WebDriverException;
import org.openqa.selenium.JavascriptExecutor;
--- data/flood/files/FloodTestScenario.scala 2017-10-12 07:47:29.000000000 +0200
+++ data copy/flood/files/FloodTestScenario.scala 2017-10-12 09:25:02.000000000 +0200
@@ -10,7 +10,7 @@
// simulation name to execute.
class FloodTestScenario extends Simulation {
// Optional, Flood IO will pass in threads, rampup and duration properties from UI
- val threads = Integer.getInteger("threads", 1)
+ val threads = Integer.getInteger("threads", 10)
val rampup = java.lang.Long.getLong("rampup", 30L)
val duration = java.lang.Long.getLong("duration", 120L)