Extension Object Model

Functionize Extensions expect an HTTPS POST request with a JSON payload as the function input:

{

    "orchestrationRunId": "",

    "testId": "903915",

    "TDMdataSetId": "",

    "orchestrationId": "0",

    "step": {...},

     "previousSteps": [...],

    "variables": {

      "project": {},

      "local": {}

    }

}

At the top level, the data structure includes information on the test case ID, orchestration IDs, and TDM data set.  In addition, it will have a step object containing all information about the current step’s context and an array of the previous step objects.  

The step object is a complex JSON containing information about the step and its user flags:

 "step": {

      "path": "",

      "optional": false,

      "action": {...},

      "output": {...}

}

The action object contains information about the action as defined in the test case some as element type, action type, various action attributes, and detailed data on the action:

"action": {

        "fileName": "Vistex_POS Golden Data_JK_MassValidations.csv",

        "fileUrl": "https://functionize.storage.googleapis.com/test-903915%2Fdownloads%2F9828f2c72200b4ae538b2ea8f1ecc94dvistexpos.csv?Expires=1668486746&GoogleAccessId=functionizesign%40wise-arch-107501.iam.gserviceaccount.com&Signature=ED3WfsZglia%2FpU5pE4UKc%2Fkod1B%2BCHqNQJU%2BEKrXMRAnjdOOQdDjOdbzBbwkBDxZEFqEzfsLyBTJJDFG1PJhUCZsrVGSE3bi%2BDFdOwXAHhFE%2ByJmFOcvON8JL6PpsJMUt3FTNpku%2FeHLkZmDThWWeNvNkUjQuXcdN9fzW4VpBhWBuUcP0LbJzSx2rmIJCjdzla%2F%2FfcNMcsvoGCbrCFJOkbSIOix7LNDmt1Y4vdCOu8HRAfUbhCXTCG7uT3we5C%2Fr%2Fah%2BmAbO8ltgUCz8C5mXsSBL1Q5as0aBMFRItgKgijJIakAX%2BAmIA7e5r1G%2BqDTmjmeVBrNpC7LOsnn5Ioz1iQ==",

        "id": "1668018653699_DVHVBC3OB0",

        "type": "UPLOAD",

        "fileData": "MjEyMjIzfEdvbGRlbiBEYXRhX0pLX01hc3N8MXwyfHxTRHx8RUEyNDFGLUJLfHx8fHx8fHx8f…"

}

Functionize provides an output object for the results of the test step including outcome information, screenshots, and data on the element interacted with in the step:

"output": {

        "foundUrl": "https://www.functionizeapp.com/tools/fileviewer",

        "result": null,

        "baseFileName": "6_chrome_new_1668018653699_DVHVBC3OB0",

        "displayScreenshotPath": "",

        "verificationResults": [],

        "postScreenshot": {

          "dimensions": null,

          "phash": null,

          "filename": "",

          "localPath": "",

          "windowState": null,

          "offset": null,

          "cloudPath": ""

        },

        "elementResult": {

          "selectionReason": "",

          "selectionType": "NONE",

          "unusedElements": [],

          "selectedElement": null,

          "failedSelection": false,

          "reusedElementResult": false,

          "warnings": []

        },

        "preScreenshot": {

          "phash": null,

          "dimensions": null,

          "windowState": null,

          "localPath": "",

          "filename": "",

          "filename": "",

          "offset": null,

          "cloudPath": ""

        }

      }

Example input JSON:

{

    "orchestrationRunId": "",

    "testId": "903915",

    "TDMdataSetId": "",

    "orchestrationId": "0"

    "step": {

      "path": "",

      "optional": false,

      "action": {

        "fileName": "Vistex_POS Golden Data_JK_MassValidations.csv",

        "fileUrl": "https://functionize.storage.googleapis.com/test-903915%2Fdownloads%2F9828f2c72200b4ae538b2ea8f1ecc94dvistexpos.csv?Expires=1668486746&GoogleAccessId=functionizesign%40wise-arch-107501.iam.gserviceaccount.com&Signature=ED3WfsZglia%2FpU5pE4UKc%2Fkod1B%2BCHqNQJU%2BEKrXMRAnjdOOQdDjOdbzBbwkBDxZEFqEzfsLyBTJJDFG1PJhUCZsrVGSE3bi%2BDFdOwXAHhFE%2ByJmFOcvON8JL6PpsJMUt3FTNpku%2FeHLkZmDThWWeNvNkUjQuXcdN9fzW4VpBhWBuUcP0LbJzSx2rmIJCjdzla%2F%2FfcNMcsvoGCbrCFJOkbSIOix7LNDmt1Y4vdCOu8HRAfUbhCXTCG7uT3we5C%2Fr%2Fah%2BmAbO8ltgUCz8C5mXsSBL1Q5as0aBMFRItgKgijJIakAX%2BAmIA7e5r1G%2BqDTmjmeVBrNpC7LOsnn5Ioz1iQ==",

        "id": "1668018653699_DVHVBC3OB0",

        "type": "UPLOAD",

        "fileData": "MjEyMjIzfEdvbGRlbiBEYXRhX0pLX01hc3N8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UlRIfDcwMzN8Tkp8VVN8fHx8RGl2ZXJzaWZpZWQgTWVkaWEgR3JvdXB8fDM4NSBNQVJLRVQgU1R8fHx8fEtFTklMV09SVEh8NzAzM3xOSnxVUw0KMjEyMjIzfEdvbGRlbiBEYXRhX0pLX01hc3N8MXwyfDIwMjEwMTAxfFNEfHxFQTI0MUYtQkt8fHx8MjAyMTAxMDF8MjAyMTAxMDF8fHx8fHwyMHwzMnx8fHxEaXZlcnNpZmllZCBNZWRpYSBHcm91cHx8fHx8fHx8fE5KfFVTfHx8fERpdmVyc2lmaWVkIE1lZGlhIEdyb3VwfHwzODUgTUFSS0VUIFNUfHx8fHxLRU5JTFdPUlRIfDcwMzN8Tkp8VVMNCg=="

      },

      "output": {

        "foundUrl": "https://www.functionizeapp.com/tools/fileviewer",

        "result": null,

        "baseFileName": "6_chrome_new_1668018653699_DVHVBC3OB0",

        "displayScreenshotPath": "",

        "verificationResults": [],

        "postScreenshot": {

          "dimensions": null,

          "phash": null,

          "filename": "",

          "localPath": "",

          "windowState": null,

          "offset": null,

          "cloudPath": ""

        },

        "elementResult": {

          "selectionReason": "",

          "selectionType": "NONE",

          "unusedElements": [],

          "selectedElement": null,

          "failedSelection": false,

          "reusedElementResult": false,

          "warnings": []

        },

        "preScreenshot": {

          "phash": null,

          "dimensions": null,

          "windowState": null,

          "localPath": "",

          "filename": "",

          "offset": null,

          "cloudPath": ""

        }

      }

    },

    "variables": {

      "project": {},

      "local": {

        "pageTitle": "Functionize"

      }

    },

    "previousSteps": [

      {

        "path": "",

        "output": {

          "result": {

            "resultCode": "PASS",

            "executorResults": [

              {

                "successful": true,

                "threshold": 0,

                "confidenceScore": 100,

                "executionMethodName": "pageinitMethod",

                "evaluatorResults": [

                  {

                    "evaluatorName": "empty",

                    "score": 100

                  }

                ],

                "totalEvals": 1

              }

            ],

            "results": [

              {

                "result": "SUCCESS",

                "message": ""

              }

            ],

            "pageLoad": null,

            "actionMessages": []

          },

          "baseFileName": "1_chrome_new_1668018629135_67G6E23YJG",

          "preScreenshot": {

            "dimensions": {

              "width": 1723,

              "height": 960

            },

            "windowState": [

              {

                "viewportHeight": 876,

                "x": 3,

                "type": "MAIN",

                "lastUpdated": 0,

                "scrollTop": 0,

                "id": "mainWindow",

                "scrollLeft": 0,

                "y": 80,

                "viewportWidth": 1715,

                "handle": "CDwindow-553275C3F82A1DD5800898BFABDDFC69"

              }

            ],

            "localPath": "/functionize/runtime/test_sessions/screenshots/1_chrome_new_1668018629135_67G6E23YJG_pre.png",

            "filename": "1_chrome_new_1668018629135_67G6E23YJG_pre.png",

            "cloudPath": "",

            "offset": null,

            "phash": null

          },

          "verificationResults": [],

          "displayScreenshotPath": "/functionize/runtime/test_sessions/screenshots/1_chrome_new_1668018629135_67G6E23YJG_post.jpg",

          "foundUrl": "https://www.google.com/",

          "postScreenshot": {

            "filename": "1_chrome_new_1668018629135_67G6E23YJG_post.jpg",

            "offset": null,

            "dimensions": {

              "height": 960,

              "width": 1723

            },

            "cloudPath": "",

            "phash": null,

            "windowState": [

              {

                "scrollTop": 0,

                "scrollLeft": 0,

                "viewportWidth": 1715,

                "x": 3,

                "lastUpdated": 0,

                "handle": "CDwindow-553275C3F82A1DD5800898BFABDDFC69",

                "y": 80,

                "id": "mainWindow",

                "viewportHeight": 876,

                "type": "MAIN"

              }

            ],

            "localPath": "/functionize/runtime/test_sessions/screenshots/1_chrome_new_1668018629135_67G6E23YJG_post.jpg"

          },

          "elementResult": {

            "selectedElement": null,

            "selectionType": "NONE",

            "warnings": [],

            "reusedElementResult": false,

            "unusedElements": [],

            "selectionReason": "",

            "failedSelection": false

          }

        },

        "optional": false,

        "action": {

          "type": "PAGE_INIT",

          "pageTitle": "",

          "url": "https://www.google.com/",

          "id": "1668018629135_67G6E23YJG"

        }

      },

      {

        "path": "",

        "optional": false,

        "action": {

          "target": "FILE_VIEWER",

          "id": "1668018638646_AFLQITFAGG",

          "type": "FILE_VIEWER",

          "newPopup": ""

        },

        "output": {

          "displayScreenshotPath": "/functionize/runtime/test_sessions/screenshots/2_chrome_new_1668018638646_AFLQITFAGG_post.jpg",

          "preScreenshot": {

            "offset": null,

            "localPath": "/functionize/runtime/test_sessions/screenshots/2_chrome_new_1668018638646_AFLQITFAGG_pre.png",

            "filename": "2_chrome_new_1668018638646_AFLQITFAGG_pre.png",

            "phash": null,

            "windowState": [

              {

                "scrollTop": 0,

                "viewportHeight": 876,

                "type": "MAIN",

                "viewportWidth": 1715,

                "handle": "CDwindow-553275C3F82A1DD5800898BFABDDFC69",

                "x": 3,

                "lastUpdated": 0,

                "id": "mainWindow",

                "y": 80,

                "scrollLeft": 0

              }

            ],

            "dimensions": {

              "width": 1723,

              "height": 960

            },

            "cloudPath": ""

          },

          "baseFileName": "2_chrome_new_1668018638646_AFLQITFAGG",

          "elementResult": {

            "warnings": [],

            "selectionReason": "",

            "unusedElements": [],

            "failedSelection": false,

            "selectionType": "NONE",

            "reusedElementResult": false,

            "selectedElement": null

          },

          "foundUrl": "https://www.google.com/",

          "postScreenshot": {

            "windowState": [

              {

                "viewportHeight": 876,

                "id": "mainWindow",

                "lastUpdated": 0,

                "viewportWidth": 1715,

                "x": 3,

                "handle": "CDwindow-553275C3F82A1DD5800898BFABDDFC69",

                "y": 80,

                "scrollTop": 0,

                "scrollLeft": 0,

                "type": "MAIN"

              }

            ],

            "localPath": "/functionize/runtime/test_sessions/screenshots/2_chrome_new_1668018638646_AFLQITFAGG_post.jpg",

            "dimensions": {

              "width": 1723,

              "height": 960

            },

            "phash": null,

            "offset": null,

            "filename": "2_chrome_new_1668018638646_AFLQITFAGG_post.jpg",

            "cloudPath": ""

          },

          "verificationResults": [],

          "result": {

            "results": [

              {

                "result": "SUCCESS",

                "message": ""

              }

            ],

            "actionMessages": [],

            "pageLoad": null,

            "executorResults": [

              {

                "totalEvals": 1,

                "executionMethodName": "fileViewerExecution",

                "successful": true,

                "confidenceScore": 100,

                "evaluatorResults": [

                  {

                    "score": 100,

                    "evaluatorName": "empty"

                  }

                ],

                "threshold": 0

              }

            ],

            "resultCode": "PASS"

          }

        }

      },

      {

        "path": "",

        "action": {

          "pageTitle": "",

          "type": "PAGE_INIT",

          "id": "1668018639466_11HEV2KTFE",

          "url": "https://www.functionizeapp.com/tools/fileviewer"

        },

        "optional": false,

        "output": {

          "baseFileName": "3_chrome_new_1668018639466_11HEV2KTFE",

          "verificationResults": [],

          "postScreenshot": {

            "localPath": "/functionize/runtime/test_sessions/screenshots/3_chrome_new_1668018639466_11HEV2KTFE_post.jpg",

            "offset": null,

            "dimensions": {

              "width": 1723,

              "height": 960

            },

            "cloudPath": "",

            "filename": "3_chrome_new_1668018639466_11HEV2KTFE_post.jpg",

            "phash": null,

            "windowState": [

              {

                "viewportHeight": 876,

                "x": 3,

                "id": "mainWindow",

                "type": "MAIN",

                "handle": "CDwindow-553275C3F82A1DD5800898BFABDDFC69",

                "y": 80,

                "viewportWidth": 1715,

                "lastUpdated": 0,

                "scrollTop": 0,

                "scrollLeft": 0

              }

            ]

          },

          "displayScreenshotPath": "/functionize/runtime/test_sessions/screenshots/3_chrome_new_1668018639466_11HEV2KTFE_post.jpg",

          "elementResult": {

            "reusedElementResult": false,

            "failedSelection": false,

            "warnings": [],

            "unusedElements": [],

            "selectionReason": "",

            "selectionType": "NONE",

            "selectedElement": null

          },

          "foundUrl": "https://www.functionizeapp.com/tools/fileviewer",

          "preScreenshot": {

            "cloudPath": "",

            "phash": null,

            "offset": null,

            "windowState": [

              {

                "lastUpdated": 0,

                "y": 80,

                "scrollLeft": 0,

                "viewportWidth": 1715,

                "id": "mainWindow",

                "handle": "CDwindow-553275C3F82A1DD5800898BFABDDFC69",

                "x": 3,

                "viewportHeight": 876,

                "scrollTop": 0,

                "type": "MAIN"

              }

            ],

            "localPath": "/functionize/runtime/test_sessions/screenshots/3_chrome_new_1668018639466_11HEV2KTFE_pre.png",

            "dimensions": {

              "width": 1723,

              "height": 960

            },

            "filename": "3_chrome_new_1668018639466_11HEV2KTFE_pre.png"

          },

          "result": {

            "results": [

              {

                "message": "",

                "result": "SUCCESS"

              }

            ],

            "actionMessages": [],

            "resultCode": "PASS",

            "pageLoad": null,

            "executorResults": [

              {

                "confidenceScore": 100,

                "successful": true,

                "evaluatorResults": [

                  {

                    "evaluatorName": "empty",

                    "score": 100

                  }

                ],

                "totalEvals": 1,

                "threshold": 0,

                "executionMethodName": "pageinitMethod"

              }

            ]

          }

        }

      },

      {

        "action": {

          "eventX": 223,

          "mouseY": 9,

          "onClickAttr": "",

          "type": "CLICK",

          "id": "1668018646491_8MO0026561",

          "newPopup": "",

          "attributeType": "file",

          "failOnInvisible": false,

          "mouseX": 35,

          "eventY": 320

        },

        "optional": false,

        "path": "",

        "output": {

          "verificationResults": [],

          "foundUrl": "https://www.functionizeapp.com/tools/fileviewer",

          "displayScreenshotPath": "/functionize/runtime/test_sessions/screenshots/4_chrome_new_1668018646491_8MO0026561_pre.png",

          "baseFileName": "4_chrome_new_1668018646491_8MO0026561",

          "result": {

            "executorResults": [

              {

                "successful": true,

                "executionMethodName": "nativeActionByPaint",

                "totalEvals": 0,

                "evaluatorResults": [],

                "threshold": 0,

                "confidenceScore": 0

              }

            ],

            "results": [

              {

                "message": "",

                "result": "SUCCESS"

              }

            ],

            "pageLoad": null,

            "resultCode": "PASS",

            "actionMessages": []

          },

          "preScreenshot": {

            "dimensions": {

              "width": 1723,

              "height": 960

            },

            "localPath": "/functionize/runtime/test_sessions/screenshots/4_chrome_new_1668018646491_8MO0026561_pre.png",

            "filename": "4_chrome_new_1668018646491_8MO0026561_pre.png",

            "offset": {

              "y": 81,

              "x": 5

            },

            "phash": null,

            "windowState": [

              {

                "viewportHeight": 876,

                "viewportWidth": 1715,

                "lastUpdated": 0,

                "id": "mainWindow",

                "y": 80,

                "scrollTop": 0,

                "type": "MAIN",

                "x": 3,

                "handle": "CDwindow-553275C3F82A1DD5800898BFABDDFC69",

                "scrollLeft": 0

              }

            ],

            "cloudPath": ""

          },

          "elementResult": {

            "warnings": [],

            "reusedElementResult": false,

            "selectedElement": {

              "selectors": [],

              "mlId": "147",

              "matchScore": 0,

              "location": {

                "x": 185,

                "y": 310

              },

              "attributes": {

                "children": [

                  {},

                  {},

                  {},

                  {},

                  {}

                ],

                "attributes": {

                  "nodetype": "1",

                  "opacity": "1",

                  "text": "",

                  "display": "block",

                  "right": "0.0",

                  "visibility": "visible",

                  "color": "rgb(103, 103, 103)",

                  "width": "277.0",

                  "type": "file",

                  "element": "INPUT",

                  "top": "310.78125",

                  "zi": "auto",

                  "left": "185.82812",

                  "backendnodeid": "89",

                  "pv": "1",

                  "height": "22.0",

                  "id": "viewserFile",

                  "position": "static",

                  "backgroundcolor": "rgba(0, 0, 0, 0)",

                  "name": "viewserFile"

                },

                "parents": [

                  {},

                  {},

                  {},

                  {},

                  {}

                ]

              },

              "desktopRelativePosition": {

                "point": {

                  "y": 391,

                  "x": 190

                },

                "height": 22,

                "y": 391,

                "width": 277,

                "dimension": {

                  "width": 277,

                  "height": 22

                },

                "x": 190

              },

              "size": {

                "width": 277,

                "height": 22

              },

              "stale": false,

              "contentEditable": false,

              "paintPoint": {

                "y": 391,

                "x": 190

              },

              "mlConfidence": 1,

              "screenshotRelativePosition": {

                "y": 391,

                "height": 22,

                "width": 277,

                "point": {

                  "y": 391,

                  "x": 190

                },

                "x": 190,

                "dimension": {

                  "height": 22,

                  "width": 277

                }

              },

              "viewportRelativePosition": {

                "width": 277,

                "x": 185.828125,

                "bottom": 332.78125,

                "right": 462.828125,

                "left": 185.828125,

                "height": 22,

                "y": 310.78125,

                "top": 310.78125

              },

              "displayed": true

            },

            "unusedElements": [],

            "selectionReason": "",

            "failedSelection": false,

            "selectionType": "ML"

          },

          "postScreenshot": {

            "localPath": "/functionize/runtime/test_sessions/screenshots/4_chrome_new_1668018646491_8MO0026561_post.jpg",

            "filename": "4_chrome_new_1668018646491_8MO0026561_post.jpg",

            "dimensions": {

              "height": 960,

              "width": 1723

            },

            "phash": null,

            "windowState": [

              {

                "id": "mainWindow",

                "y": 80,

                "lastUpdated": 0,

                "viewportWidth": 1715,

                "x": 3,

                "type": "MAIN",

                "handle": "CDwindow-553275C3F82A1DD5800898BFABDDFC69",

                "viewportHeight": 876,

                "scrollLeft": 0,

                "scrollTop": 0

              }

            ],

            "cloudPath": "",

            "offset": null

          }

        }

      },

      {

        "output": {

          "verificationResults": [],

          "foundUrl": "https://www.functionizeapp.com/tools/fileviewer",

          "displayScreenshotPath": "/functionize/runtime/test_sessions/screenshots/5_chrome_new_1668039002334_WZNUREELYD_post.jpg",

          "elementResult": {

            "unusedElements": [],

            "failedSelection": false,

            "reusedElementResult": false,

            "selectionType": "NONE",

            "warnings": [],

            "selectionReason": "",

            "selectedElement": null

          },

          "preScreenshot": {

            "filename": "5_chrome_new_1668039002334_WZNUREELYD_pre.png",

            "dimensions": {

              "width": 1723,

              "height": 960

            },

            "windowState": [

              {

                "y": 80,

                "viewportHeight": 876,

                "handle": "CDwindow-553275C3F82A1DD5800898BFABDDFC69",

                "x": 3,

                "id": "mainWindow",

                "scrollLeft": 0,

                "scrollTop": 0,

                "type": "MAIN",

                "viewportWidth": 1715,

                "lastUpdated": 0

              }

            ],

            "cloudPath": "",

            "offset": null,

            "localPath": "/functionize/runtime/test_sessions/screenshots/5_chrome_new_1668039002334_WZNUREELYD_pre.png",

            "phash": null

          },

          "result": {

            "actionMessages": [],

            "results": [

              {

                "message": "",

                "result": "SUCCESS"

              }

            ],

            "executorResults": [

              {

                "evaluatorResults": [

                  {

                    "evaluatorName": "empty",

                    "score": 100

                  }

                ],

                "confidenceScore": 100,

                "executionMethodName": "javascriptMethod",

                "successful": true,

                "totalEvals": 1,

                "threshold": 0

              }

            ],

            "resultCode": "PASS",

            "pageLoad": null

          },

          "baseFileName": "5_chrome_new_1668039002334_WZNUREELYD",

          "postScreenshot": {

            "filename": "5_chrome_new_1668039002334_WZNUREELYD_post.jpg",

            "cloudPath": "",

            "dimensions": {

              "width": 1723,

              "height": 960

            },

            "phash": null,

            "localPath": "/functionize/runtime/test_sessions/screenshots/5_chrome_new_1668039002334_WZNUREELYD_post.jpg",

            "offset": null,

            "windowState": [

              {

                "y": 80,

                "type": "MAIN",

                "id": "mainWindow",

                "handle": "CDwindow-553275C3F82A1DD5800898BFABDDFC69",

                "lastUpdated": 0,

                "viewportWidth": 1715,

                "x": 3,

                "scrollTop": 0,

                "viewportHeight": 876,

                "scrollLeft": 0

              }

            ]

          }

        },

        "optional": false,

        "path": "",

        "action": {

          "elementCode": "fze.local.pageTitle = document.title;",

          "type": "SET_VARIABLE",

          "id": "1668039002334_WZNUREELYD"

        }

      }

    ],

 }

 

Manipulating Tests Via Extensions

Now that you have a reasonable overview of the data models used in Functionize we are going to cover how you can manipulate values in test execution by returning and overloading data received.

All we need is to provide an updated JSON object with the relevant fields redefined and sent back:    

let result = {

"updates": {

"variables": {

"local": {

    "foo": "bar"

}

     }

   }

 };

 res.status(200).send(result);

In the above example, we set a new local variable “foo” with a value of "bar". 

You can also simply fail a step, upsetting the result object in outputs:

let result = {

"updates": {

"step": {

"output": {

    "results": ["result": "FAIL", "message": "Step failed in extension."]

}

     }

   }

 };

 res.status(200).send(result);