Manage Elements using REST API


NOTE:

You need to authenticate these requests with your Testsigma API Key. See How to generate API Keys.


Element parameters

Before we check the actual requests, let’s go through some Element properties that you will find in the Request and Response

  • name: Name of the Element to be created
  • locatorType: Either one of ‘xpath’, ‘css selector’, ‘linktext’, ‘classname’, ‘tagname’, ‘name’, or ‘ID’
  • definition: The locator definition for the Element
  • createdBy: The User ID of the creator
  • Status: Status of the Element in Element Review Management. Either ‘Ready’, ‘Draft’
  • screenName: ID of the screen name
  • applicationVersionId: ID of Version where the Element is to be created
  • createdType: Creation Mode of the Element. Either ‘Chrome’, ‘Advanced’, or ‘Manual’

API Specification

Get Elements

Get all the available elements in the Project

Get an Element

Get a specific element in the Project by Element Id

<ELEMENT_ID> is the id of the specific element you want to fetch.

Create Element

Create a new Element

Request Body:

{

   "name": "TestUIID",

   "locatorType": "xpath",

   "definition" : "//test/div",

   "createdBy": "USED_ID",

   "status": "READY",

   "screenNameId": "<SCREEN_NAME_ID>",

   "applicationVersionId": "<VERSION_ID>",

   "createdType": "CHROME"

}

Update Element

Update the details regarding an existing element

Request Body:

{

   "name": "TestUIID",

   "locatorType": "xpath",

   "definition" : "//test/div",

   "createdBy": "USED_ID",

   "status": "READY",

   "screenNameId": "<SCREEN_NAME_ID>",

   "applicationVersionId": "<VERSION_ID>",

   "createdType": "CHROME"

}