IdentifyAs

Creates a state uniquely identified by the given string and applies it to the browser. This guarantees that the browser will perform the preceding actions each time this action runs on a distinct string.

Syntax

State.IdentifyAs
   ·  [name]

Parameters

name
The name used to uniquely identify the resulting state.

Remarks

This action can be placed below a Browser.Wait action to force the browser to wait each time this action runs.

As an example, consider the following set of actions:

Data.Input
as (productId)
Browser.Wait
   ·  5000
Ajax.Example
   ·  +
         ·  "http://www.example.com/api/products?id="
         ·  productId

Here, if Data.Input contains a list of product IDs, the Browser.Wait action will wait for 5 seconds before the first AJAX request. Then, since the browser will already be on the waited state, the Browser.Wait action won't need to run again, and every subsequent request will be performed without any delay.

If we wish to wait before each request, we can accomplish this by passing the productId to the State.IdentifyAs action, since each request would run on a state that is uniquely identified by the product ID, and before any new state is applied to the browser, the preceding states are always applied:

Data.Input
as (productId)
Browser.Wait
   ·  5000
State.IdentifyAs
   ·  productId
Ajax.Example
   ·  +
         ·  "http://www.example.com/api/products?id="
         ·  productId

Note that if Auto Parallel is enabled on the project settings, as many requests as off-screen browsers would run simultaneously on both cases.