Giter Club home page Giter Club logo

jsniff.net's Introduction

jSniff.NET

jSniff.NET is [jSniff.js] for .NET developers to be used with Selenium WebDriver [jSniff.js]:https://github.com/galziv/jSniff

How to use

Check [jSniff.js] for more details on the functions.

Initialize the jSniff manager with Selenium web driver

jSniff.Manager manager = new Manager(new ChromeDriver());

sniff the function using:

Manager.Sniffify

public Sniff Sniffify(string obj, string functionName, string sniffName, string customFunc = "")
  • obj: The object on which the function exists (if it is a function declaration then use window)
  • funcName: The name of the function
  • sniffName: The name for the sniff. It is later used when retrieving the invocations data
  • customFunc: A custom function which will be executed prior to the original function's code

lets assume we have a javascript client function declaration as follows:

function multiply(a,b){
    return a*b;
}

so to sniff it we execute:

Sniff sniff = manager.Sniffify("window", "multiply", "window_multiply", "function() { console.log('log from custom function');}");

Sniff Class Methods

GetInvocations


public Invocation[] GetInvocations(string sniffName)

This method returns an array of Invocation object. Invocation object consists of the sniffed data and has two properties:

  • executionDate: Javascript Date object with the execution date.
  • params: Array of the execution parameters. Each element in array is Dictionary<string, object> (parameter name,paramter value)

GetLastInvocation


pubilc Invocation GetLastInvocation(string sniffName)

This method returns the last execution sniffed data. the Invocation object has two properties:

  • executionDate: Javascript Date object with the execution date.
  • params: Array of the execution parameters. Each element in array is Dictionary<string, object> (parameter name,paramter value)

GetInvocations


Dictionary<string, object> GetLastInvocationParams(string sniffName)

This method returns an array of the last execution parameters. Each element in the array is Dictionary<string, object> (parameter name,paramter value)


Invocation Class Propeties


DateTime ExecutionDate
long Duration
Dictionary<string, object> ExecutionParameters
  • Duration is in milliseconds
  • ExecutionParameters<parameter name, paramter value>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.