Leverage this API in your HTML by adding 'mockapi-browser.js' using a <script> tag

setMockRespond(server, port, configurations)

POST request to register mock response. Once you register, whenever server receives a request matching the registered requestPath, it will respond with a fake response

server => url of web-server.js running on node
port => port number of web-server.js running on node
configurations => JSON object containing mock configuration. Possible configurations are "requestPath", "contentType", "statusCode", "responseText", "id", "keyValues" (JSON), "delayTime", "header" (JSON), and "eval".


registerTemplate(server, port, template, id)

Method to register a template to be used when mocking responses. Once registered, pass the same id used to register the template along with a map containing the key-value pairs that are to be replaced.

server => url of web-server.js running on node
port => port number of web-server.js running on node
template => a template in the form of a string or JSONObject that is to be used for responses
id => the id to be used as a key for the template which is used when setting a fake response


setInterceptXHR(server, port, requestPath)

Method to register intercept XHR. Once you register, whenever server receives a request matching the registered requestPath, it will intercept and store for later retrieval.

server => url of web-server.js running on node
port => port number of web-server.js running on node
requestPath => path which you want to intercept.


getInterceptedXHR(server, port, requestPath, callback)

Method to retrieve intercepted XHRs. Use in conjunction with setInterceptXHR().

server => url of web-server.js running on node
port => port number of web-server.js running on node
requestPath => path which you have intercepted.
callback => method to call to validate. responseText will be provided to callback


setParamIgnored(server, port, params)

Method to set up parameters that will be ignored in the URL.
server => url of web-server.js running on node
port => port number of web-server.js running on node
params => parameters that will be ignored in the app URL, type is string.
For example,if we set ignore paramB, URL http://aa.bb.com/result?paramA=123&paramB=456 will be treated as http://aa.bb.com/result?paramA=123


unRegisterMock(server, port, requestPath)

Method to delete registered mock response.

server => url of web-server.js running on node
port => port number of web-server.js running on node
requestPath => mock response path that needs to be deleted, if empty then delete all the registered mock responses.



Leverage this API in your HTML by adding 'appcontainer-driver.js' using a <script> tag

openApp(url)

Creates an iframe inside the current DOM and opens the app via url

url => url of app running on msl-server


getApp()

Checks if the iframe exists and returns the iframe element if exists. Must call openApp() first to create the iframe if not existing.


getElement(elementLoc)

Checks if the iframe exists and then returns a new Element object represented by the element location specified inside the iframe.

elementLoc => jQuery locator representing an element inside the iframe


checkAppContainerReady()

Checks whether iframe exists. If not, it throws an error.


doEval(eval)

Checks if the iframe exists and executes eval inside the iframe.
eval => eval string to evaluate inside the iframe


Element.getJQueryElement()

Returns the JQuery element object represented by the locator.


Element.val()

Returns the text of the value attribute of the element.


Element.val(str)

Sets the value attribute on the element.

str => value string to be set


Element.text()

Returns the string contained in the text node of the element.


Element.attr(attributeName)

Returns the string value of a specific attribute

attributeName => name of the attribute


Element.attr(attributeName, value)

Sets the string value of a specific attribute

attributeName => name of the attribute
value => value string to be set


Element.size()

Returns the number of the elements in the object.


Element.keydown()

Performs keydown event on the element.


Element.keypress()

Performs keypress event on the element.


Element.keyup()

Performs keyup event on the element.


Element.click()

Performs click event on the element.


Element.dblclick()

Performs double click event on the element.


Element.focusout()

Performs focus out event on the element.


Element.hover()

Performs hover event on the element.


Element.mousedown()

Performs mouse down event on the element.


Element.mouseenter()

Performs mouse enter event on the element.


Element.mouseleave()

Performs mouse levae event on the element.


Element.mousemove()

Performs mouse move event on the element.


Element.mouseout()

Performs mouse out event on the element.


Element.mouseover()

Performs mouse over event on the element.


Element.mouseup()

Performs mouse up event on the element.


Element.toggle()

Performs toggle event on the element.


Leverage this API via adding dependency to 'msl-client-java' package and using MockAPI static class

public static String setMockRespond(String server, int port, Map configurations)

POST request to register mock response. Once you register, whenever server receives a request matching the registered requestPath, it will respond with a fake response

String server => url of web-server.js running on node
int port => port number of web-server.js running on node
Map configurations => Map containing mock configuration. Possible configurations are "requestPath", "contentType", "statusCode", "responseText", "id", "keyValues" (Map), "delayTime", "header" (Map), and "eval".


public static String registerTemplate(String server, int port, String template, String id)

Method to register a template to be used when mocking responses. Once registered, pass the same id used to register the template along with a map containing the key-value pairs that are to be replaced.

String server => url of web-server.js running on node
int port => port number of web-server.js running on node
String template => a template in the form of a string or JSONObject that is to be used for responses
String id => the id to be used as a key for the template which is used when setting a fake response


public static String setInterceptXHR(String server, int port, String requestPath)

Method to register intercept XHR. Once you register, whenever server receives a request matching the registered requestPath, it will intercept and store for later retrieval.

String server => url of web-server.js running on node
int port => port number of web-server.js running on node
String requestPath => path which you want to intercept.


public static XHR[] getInterceptedXHR(String server, int port, String requestPath)

Method to retrieve intercepted XHRs. Use in conjunction with setInterceptXHR().

String server => url of web-server.js running on node
int port => port number of web-server.js running on node
String requestPath => path which you want to mock a fake response with


String setParamIgnored(String server, int port, String params)

Method to set up parameters that will be ignored in the URL.

String server => url of web-server.js running on node
int port => port number of web-server.js running on node
String params => parameters that will be ignored in the app URL, type is string.
For example,if we set ignore paramB, URL http://aa.bb.com/result?paramA=123&paramB=456 will be treated as http://aa.bb.com/result?paramA=123


public static String unRegisterMock(String server, int port, String requestPath)

Method to delete registered mock response.

String server => url of web-server.js running on node
int port => port number of web-server.js running on node
String requestPath => mock response path that needs to be deleted.


public static String unRegisterMock(String server, int port)

Method to delete registered mock response.

String server => url of web-server.js running on node
int port => port number of web-server.js running on node
String requestPath => Delete all the registered mock responses.


Leverage this API in your Node script via requiring 'msl-client' using require

setMockRespond(server, port, configurations)

POST request to register mock response. Once you register, whenever server receives a request matching the registered requestPath, it will respond with a fake response

server => url of web-server.js running on node
port => port number of web-server.js running on node
configurations => JSON object containing mock configuration. Possible configurations are "requestPath", "contentType", "statusCode", "responseText", "id", "keyValues" (JSON), "delayTime", "header" (JSON), and "eval".


registerTemplate(server, port, template, id)

Method to register a template to be used when mocking responses. Once registered, pass the same id used to register the template along with a map containing the key-value pairs that are to be replaced.

server => url of web-server.js running on node
port => port number of web-server.js running on node
template => a template in the form of a string or JSONObject that is to be used for responses
id => the id to be used as a key for the template which is used when setting a fake response


setInterceptXHR(server, port, requestPath)

Method to register intercept XHR. Once you register, whenever server receives a request matching the registered requestPath, it will intercept and store for later retrieval.

server => url of web-server.js running on node
port => port number of web-server.js running on node
requestPath => path which you want to intercept.


getInterceptedXHR(server, port, requestPath, callback)

Method to retrieve intercepted XHRs. Use in conjunction with setInterceptXHR().

server => url of web-server.js running on node
port => port number of web-server.js running on node
requestPath => path which you have intercepted.
callback => method to call to validate. responseText will be provided to callback


setParamIgnored(server, port, params)

Method to set up parameters that will be ignored in the URL.

server => url of web-server.js running on node
port => port number of web-server.js running on node
params => parameters that will be ignored in the app URL, type is string.
For example,if we set ignore paramB, URL http://aa.bb.com/result?paramA=123&paramB=456 will be treated as http://aa.bb.com/result?paramA=123


unRegisterMock(server, port, requestPath)

Method to delete registered mock response.

server => url of web-server.js running on node
port => port number of web-server.js running on node
requestPath => mock response path that needs to be deleted, if empty then delete all the registered mock responses.


Leverage this API in your Python script by importing 'mslclient' using import

setMockRespond(server, port, configurations)

POST request to register mock response. Once you register, whenever server receives a request matching the registered requestPath, it will respond with a fake response

server => url of web-server.js running on node
port => port number of web-server.js running on node
configurations => JSON object containing mock configuration. Possible configurations are "requestPath", "contentType", "statusCode", "responseText", "id", "keyValues" (JSON), "delayTime", "header" (JSON), and "eval".


registerTemplate(server, port, template, id)

Method to register a template to be used when mocking responses. Once registered, pass the same id used to register the template along with a map containing the key-value pairs that are to be replaced.

server => url of web-server.js running on node
port => port number of web-server.js running on node
template => a template in the form of a string or JSONObject that is to be used for responses
id => the id to be used as a key for the template which is used when setting a fake response


setInterceptXHR(server, port, requestPath)

Method to register intercept XHR. Once you register, whenever server receives a request matching the registered requestPath, it will intercept and store for later retrieval.

server => url of web-server.js running on node
port => port number of web-server.js running on node
requestPath => path which you want to intercept.


getInterceptedXHR(server, port, requestPath)

Method to retrieve intercepted XHRs. Use in conjunction with setInterceptXHR().

server => url of web-server.js running on node
port => port number of web-server.js running on node
requestPath => path which you have intercepted.


setParamIgnored(server, port, params)

Method to set up parameters that will be ignored in the URL.
server => url of web-server.js running on node
port => port number of web-server.js running on node
params => parameters that will be ignored in the app URL, type is string.
For example,if we set ignore paramB, URL http://aa.bb.com/result?paramA=123&paramB=456 will be treated as http://aa.bb.com/result?paramA=123


unRegisterMock(server, port, requestPath)

Method to delete registered mock response.

server => url of web-server.js running on node
port => port number of web-server.js running on node
requestPath => mock response path that needs to be deleted, if empty then delete all the registered mock responses.



Leverage this API in your Ruby script by requiring 'msl-client' using a require

setMockRespond(server, port, configurations)

POST request to register mock response. Once you register, whenever server receives a request matching the registered requestPath, it will respond with a fake response

server => url of web-server.js running on node
port => port number of web-server.js running on node
configurations => JSON object containing mock configuration. Possible configurations are "requestPath", "contentType", "statusCode", "responseText", "id", "keyValues" (JSON), "delayTime", "header" (JSON), and "eval".


registerTemplate(server, port, template, id)

Method to register a template to be used when mocking responses. Once registered, pass the same id used to register the template along with a map containing the key-value pairs that are to be replaced.

server => url of web-server.js running on node
port => port number of web-server.js running on node
template => a template in the form of a string or JSONObject that is to be used for responses
id => the id to be used as a key for the template which is used when setting a fake response


setInterceptXHR(server, port, requestPath)

Method to register intercept XHR. Once you register, whenever server receives a request matching the registered requestPath, it will intercept and store for later retrieval.

server => url of web-server.js running on node
port => port number of web-server.js running on node
requestPath => path which you want to intercept.


getInterceptedXHR(server, port, requestPath)

Method to retrieve intercepted XHRs. Use in conjunction with setInterceptXHR().

server => url of web-server.js running on node
port => port number of web-server.js running on node
requestPath => path which you have intercepted.


setParamIgnored(server, port, params)

Method to set up parameters that will be ignored in the URL.
server => url of web-server.js running on node
port => port number of web-server.js running on node
params => parameters that will be ignored in the app URL, type is string.
For example,if we set ignore paramB, URL http://aa.bb.com/result?paramA=123&paramB=456 will be treated as http://aa.bb.com/result?paramA=123


unRegisterMock(server, port, requestPath)

Method to delete registered mock response.

server => url of web-server.js running on node
port => port number of web-server.js running on node
requestPath => mock response path that needs to be deleted, if empty then delete all the registered mock responses.