Skip to content

Instantly share code, notes, and snippets.

View swapnil-kotwal-sp's full-sized avatar
🎯
Focusing

Swapnil kotwal swapnil-kotwal-sp

🎯
Focusing
  • SailPoint Technologies
  • Pune
View GitHub Profile
var fileBFeeder = csv("fileB.csv").circular
val scn = scenario("test")
.feed(fileBFeeder)
.exec(http("My Req")
.get("/api/users")
.check(
regex("""${account_id}""")
.saveAs("account_id")))
.exec(session => {
@swapnil-kotwal-sp
swapnil-kotwal-sp / git_stash
Created July 13, 2015 06:54
git stash daily use commands
git stash (save changes temporarily to get pull/switch branch etc.)
1. git stash save "message" :- save local changes temporary
2. git stash apply :- apply stash changes without dropping it
3. git stash pop :- remove stash and apply
4. git stash drop :- remove stashed changes without applying it
5. git stash show -p stash@{0} :- see what stashed @index 0
git stash only one file
1. git add app/controllers/cart_controller.java
@swapnil-kotwal-sp
swapnil-kotwal-sp / Conditions.java
Last active August 29, 2015 14:14
Code Snippets for conditions check
if ((parserFailureConditions != null)
&& (parserFailureConditions.length != 0)) {
numberOfParserFailureConditions = getNumberOfFailureConditions(parserFailureConditions[0]);
}
/*
* As the the passed array holds JSON String at first location,
* this method initialize the 'number_failureConditions' based on no. of JSON elements.
*/
public int getNumberOfFailureConditions(String condition) {
package com.test.actor;
import com.benbria.actor.Actor;
import com.benbria.actor.Behaviour;
import com.benbria.actor.ThreadActor;
public class ActorExample {
public static void main(String[] args) throws InterruptedException {
Actor<String> actor = ThreadActor.spawn(new Behaviour<String>() {
@Override
@swapnil-kotwal-sp
swapnil-kotwal-sp / login.scala
Created September 3, 2014 11:07
Basic Login functionality for you web app using Gatling DSL.
Make sure you have "login.csv" in gatling data folder and
"login.csv" contains proper creadentials to login into your web app.
package mywebapp.lib
import scala.concurrent.duration._
import io.gatling.core.Predef._
import io.gatling.http.Predef._
import io.gatling.jdbc.Predef._
import mywebapp.config._
class ExampleSimulation extends TestableSimulation {
describe("foo")
before {
println("executed before gatling")
}
setUp(
// ...
trait TestableSimulation extends Simulation with FlatSpecLike with BeforeAndAfter {
val props = scala.collection.mutable.Map.empty[String, String]
for { p <- sys.props if (p._1.startsWith("gatling")) } yield { props += p }
GatlingConfiguration.setUp(props)
val simClass = getClass.asInstanceOf[Class[io.gatling.core.scenario.Simulation]]
val cleanSimClassName = simClass.getSimpleName.clean
val outputDirectoryName = configuration.core.outputDirectoryBaseName.getOrElse(cleanSimClassName)
var selection = new Selection(simClass, outputDirectoryName, "no description")
class ExampleSimulation extends TestableSimulation {
describe("foo")
before {
println("executed before gatling")
}
setUp(
// ...
import java.io.IOException;
import java.net.URL;
import java.util.Date;
import java.util.List;
import java.util.logging.Level;
import org.json.*;
import org.openqa.selenium.*;
import org.openqa.selenium.chrome.*;
import org.openqa.selenium.logging.*;