Extension Requests
Below are sample .json objects that may be passed into the 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 into the request and will contain objects identical to the sample actions below.
These can be used in 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 our to support.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Extension Responses
For Prehooks where you want to set a value before the action takes place, your response can look like the following. Note that the 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 Posthooks, you may want to set a pass or a fail for the action based on what occurred with this, or previous actions. The response from your extension should look something like this. The status may be "pass" or "fail". If "fail", an additional message may be used for display to the web application upon a 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: