Skip to content

The Cursor Object

Udit Vasu edited this page Mar 14, 2021 · 1 revision

The cursor holds the details of the current state of the run. It's accessible in every Newman run event using args.cursor.

The cursor object will always have the following properties:

Property Data Type Description
length Number Total number of items in the collection run
cycles Number Total number of iterations that will be repeated on the length
position Number Current index of the item being processed from within the total number of items
iteration Number The current cycle in the total iteration count
ref String A common item identifier in an execution cycle ​
bof Boolean Is this cursor position at the beginning of the run
eof Boolean Is this cursor position at the end of the run
cr Boolean Is this cursor position going to change to the next cycle
empty Boolean The run is empty and there is nothing to execute

Additionally, the following dynamic properties are added during the execution:

  • scriptId - A unique identifier added during the Script execution
  • httpRequestId - A unique identifier added during the Item execution (prerequest -> request -> test)