Functionize Extension Samples Overview
Below are sample .json objects that may be passed into an Extension with these particular Action Types. In addition to the current action information, previous action data will also be sent so that multi-step information can be processed within the Extension. An array called previousSteps will be included in the request and will contain objects identical to the sample actions below.
These can be used in the Run Parameters Body for testing your Extensions:
Request for Input Action
{
"previousSteps": [
{
"path": "",
"optional": false,
"action": actionObjectAsBelow,
"output": outputObjectAsBelow
},
{
"path": "",
"optional": false,
"action": actionObjectAsBelow,
"output": outputObjectAsBelow
}
],
"step": {
"path": "",
"optional": false,
"output": {
"result": null,
"elementResult": null,
"baseFileName": "3 _chrome_new_1533082145693_X2LT2UKABZQ1B3J",
"verificationResults": [],
"foundUrl": null,
"postScreenshot": null,
"preScreenshot": null,
"displayScreenshotPath": null
},
"action": {
"id": "1533082145693_X2LT2UKABZQ1B3J",
"type": "INPUT",
"value": "marbles < fze - date > mints"
}
}
}
Request for Click Action
{
"step": {
"path": "",
"optional": false,
"action": {
"id": "1533082139889_YPPDQ6J0A6JEIC6",
"type": "CLICK"
},
"output": {
"result": null,
"elementResult": null,
"baseFileName": "2 _chrome_new_1533082139889_YPPDQ6J0A6JEIC6",
"verificationResults": [],
"displayScreenshotPath": null,
"foundUrl": null,
"postScreenshot": null,
"preScreenshot": null
}
}
}
Request for Page Init Action
{
"step": {
"path": "",
"optional": false,
"action": {
"pageTitle": "",
"id": "1533082131294 _33Z3UHK98EX2CN8",
"type": "PAGE_INIT",
"url": "https://www.google.com/"
},
"output": {
"result": null,
"elementResult": null,
"foundUrl": null,
"postScreenshot": null,
"preScreenshot": null,
"baseFileName": "0_chrome_new_1533082131294_33Z3UHK98EX2CN8",
"verificationResults": [],
"displayScreenshotPath": null
}
}
}
Request for Resize Action
{
"step": {
"path":"" ,
"optional": false,
"output": {
"result": null,
"elementResult": null,
"displayScreenshotPath": null,
"verificationResults": [],
"postScreenshot": null,
"preScreenshot": null,
"baseFileName": "1_chrome_new_1533082134164_QAYUGEY0MJTFNUC",
"foundUrl": null
},
"action": {
"windowsHeight": 712,
"windowsWidth": 1535,
"id": "1533082134164_QAYUGEY0MJTFNUC",
"type": "RESIZE"
}
}
}
Request for Wait Action
{
"step": {
"path": "",
"optional": false,
"output": {
"result": null,
"elementResult": null,
"displayScreenshotPath": null,
"foundUrl": null,
"postScreenshot": null,
"preScreenshot": null,
"baseFileName": "1_chrome_new_1588950647647_4NYWNJ58YQXOW59",
"verificationResults": []
},
"action": {
"id": "1588950647647_4NYWNJ58YQXOW59",
"time": 4000,
"type": "WAIT"
}
}
}
Extensions Supported Fields
The attributes under 'action' in the input can vary depending on the type of action occurring. The following is a list of attributes currently supported, depending on the type of attribute. For specific questions, please reach out to the Functionize Support team.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Extension Responses
For Pre-hooks, where you want to set a value before the action takes place, your response can look like the following.
Note: Formatting must match exactly.
Sample Input Action Response
{
"updates": {
"action": {
"attributes": {
"value": "new value to set"
}
}
}
}
Sample Wait Action Response
Here is an example modifying the wait time for a Wait Action. This response will modify the wait time to 9 seconds.
{
"updates": {
"action": {
"attributes": {
"time": 9000
}
}
}
}
For Post-hooks, you may want to set a pass or fail for the action based on what occurred with this or previous actions. The response from your Extension should look something like the example below. The status may be 'pass' or 'fail'. If 'fail', an additional message may be used to display to the web application upon failure.
{
"updates": {
"stepResult": {
"status": "fail",
"message": "Because the extension said so"
}
}
}
A failed action due to an extension will appear like this in the Slider View: